agent-claw: automated task changes

This commit is contained in:
daniel
2026-05-06 18:55:16 -05:00
parent 38905bb1e9
commit 732b00fb66
8494 changed files with 2018127 additions and 4 deletions

View File

@@ -0,0 +1,82 @@
import type { Construct } from 'constructs';
import type { ISecurityGroup, SubnetSelection } from '../../../aws-ec2';
import type { HealthCheck } from '../../../aws-ecs';
import { FargateService, FargateTaskDefinition } from '../../../aws-ecs';
import type { ApplicationLoadBalancedServiceBaseProps } from '../base/application-load-balanced-service-base';
import { ApplicationLoadBalancedServiceBase } from '../base/application-load-balanced-service-base';
import type { FargateServiceBaseProps } from '../base/fargate-service-base';
/**
* The properties for the ApplicationLoadBalancedFargateService service.
*/
export interface ApplicationLoadBalancedFargateServiceProps extends ApplicationLoadBalancedServiceBaseProps, FargateServiceBaseProps {
/**
* Determines whether the service will be assigned a public IP address.
*
* @default false
*/
readonly assignPublicIp?: boolean;
/**
* The subnets to associate with the service.
*
* @default - Public subnets if `assignPublicIp` is set, otherwise the first available one of Private, Isolated, Public, in that order.
*/
readonly taskSubnets?: SubnetSelection;
/**
* The security groups to associate with the service. If you do not specify a security group, a new security group is created.
*
* @default - A new security group is created.
*/
readonly securityGroups?: ISecurityGroup[];
/**
* The health check command and associated configuration parameters for the container.
*
* @default - Health check configuration from container.
*/
readonly healthCheck?: HealthCheck;
/**
* The minimum number of CPU units to reserve for the container.
*
* @default - No minimum CPU units reserved.
*/
readonly containerCpu?: number;
/**
* The amount (in MiB) of memory to present to the container.
*
* If your container attempts to exceed the allocated memory, the container
* is terminated.
*
* @default - No memory limit.
*/
readonly containerMemoryLimitMiB?: number;
}
/**
* A Fargate service running on an ECS cluster fronted by an application load balancer.
*/
export declare class ApplicationLoadBalancedFargateService extends ApplicationLoadBalancedServiceBase {
/**
* Uniquely identifies this class.
*/
static readonly PROPERTY_INJECTION_ID: string;
/**
* Determines whether the service will be assigned a public IP address.
*/
readonly assignPublicIp: boolean;
/**
* The Fargate service in this construct.
*/
readonly service: FargateService;
/**
* The Fargate task definition in this construct.
*/
readonly taskDefinition: FargateTaskDefinition;
/**
* Constructs a new instance of the ApplicationLoadBalancedFargateService class.
*/
constructor(scope: Construct, id: string, props?: ApplicationLoadBalancedFargateServiceProps);
/**
* Throws an error if the specified percent is not an integer or negative.
*/
private validateHealthyPercentage;
private validateContainerCpu;
private validateContainerMemoryLimitMiB;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,48 @@
import type { Construct } from 'constructs';
import { FargateService, FargateTaskDefinition } from '../../../aws-ecs';
import type { ApplicationTargetGroup } from '../../../aws-elasticloadbalancingv2';
import type { ApplicationMultipleTargetGroupsServiceBaseProps } from '../base/application-multiple-target-groups-service-base';
import { ApplicationMultipleTargetGroupsServiceBase } from '../base/application-multiple-target-groups-service-base';
import type { FargateServiceBaseProps } from '../base/fargate-service-base';
/**
* The properties for the ApplicationMultipleTargetGroupsFargateService service.
*/
export interface ApplicationMultipleTargetGroupsFargateServiceProps extends ApplicationMultipleTargetGroupsServiceBaseProps, FargateServiceBaseProps {
/**
* Determines whether the service will be assigned a public IP address.
*
* @default false
*/
readonly assignPublicIp?: boolean;
}
/**
* A Fargate service running on an ECS cluster fronted by an application load balancer.
*/
export declare class ApplicationMultipleTargetGroupsFargateService extends ApplicationMultipleTargetGroupsServiceBase {
/**
* Uniquely identifies this class.
*/
static readonly PROPERTY_INJECTION_ID: string;
/**
* Determines whether the service will be assigned a public IP address.
*/
readonly assignPublicIp: boolean;
/**
* The Fargate service in this construct.
*/
readonly service: FargateService;
/**
* The Fargate task definition in this construct.
*/
readonly taskDefinition: FargateTaskDefinition;
/**
* The default target group for the service.
* @deprecated - Use `targetGroups` instead.
*/
readonly targetGroup: ApplicationTargetGroup;
/**
* Constructs a new instance of the ApplicationMultipleTargetGroupsFargateService class.
*/
constructor(scope: Construct, id: string, props?: ApplicationMultipleTargetGroupsFargateServiceProps);
private createFargateService;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,51 @@
import type { Construct } from 'constructs';
import type { ISecurityGroup, SubnetSelection } from '../../../aws-ec2';
import { FargateService, FargateTaskDefinition } from '../../../aws-ecs';
import type { FargateServiceBaseProps } from '../base/fargate-service-base';
import type { NetworkLoadBalancedServiceBaseProps } from '../base/network-load-balanced-service-base';
import { NetworkLoadBalancedServiceBase } from '../base/network-load-balanced-service-base';
/**
* The properties for the NetworkLoadBalancedFargateService service.
*/
export interface NetworkLoadBalancedFargateServiceProps extends NetworkLoadBalancedServiceBaseProps, FargateServiceBaseProps {
/**
* Determines whether the service will be assigned a public IP address.
*
* @default false
*/
readonly assignPublicIp?: boolean;
/**
* The subnets to associate with the service.
*
* @default - Public subnets if `assignPublicIp` is set, otherwise the first available one of Private, Isolated, Public, in that order.
*/
readonly taskSubnets?: SubnetSelection;
/**
* The security groups to associate with the service. If you do not specify a security group, a new security group is created.
*
* @default - A new security group is created.
*/
readonly securityGroups?: ISecurityGroup[];
}
/**
* A Fargate service running on an ECS cluster fronted by a network load balancer.
*/
export declare class NetworkLoadBalancedFargateService extends NetworkLoadBalancedServiceBase {
/**
* Uniquely identifies this class.
*/
static readonly PROPERTY_INJECTION_ID: string;
readonly assignPublicIp: boolean;
/**
* The Fargate service in this construct.
*/
readonly service: FargateService;
/**
* The Fargate task definition in this construct.
*/
readonly taskDefinition: FargateTaskDefinition;
/**
* Constructs a new instance of the NetworkLoadBalancedFargateService class.
*/
constructor(scope: Construct, id: string, props?: NetworkLoadBalancedFargateServiceProps);
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,64 @@
import type { Construct } from 'constructs';
import { FargateService, FargateTaskDefinition } from '../../../aws-ecs';
import type { NetworkTargetGroup } from '../../../aws-elasticloadbalancingv2';
import type { FargateServiceBaseProps } from '../base/fargate-service-base';
import type { NetworkMultipleTargetGroupsServiceBaseProps } from '../base/network-multiple-target-groups-service-base';
import { NetworkMultipleTargetGroupsServiceBase } from '../base/network-multiple-target-groups-service-base';
/**
* The properties for the NetworkMultipleTargetGroupsFargateService service.
*/
export interface NetworkMultipleTargetGroupsFargateServiceProps extends NetworkMultipleTargetGroupsServiceBaseProps, FargateServiceBaseProps {
/**
* Determines whether the service will be assigned a public IP address.
*
* @default false
*/
readonly assignPublicIp?: boolean;
/**
* The minimum number of tasks, specified as a percentage of
* the Amazon ECS service's DesiredCount value, that must
* continue to run and remain healthy during a deployment.
*
* @default - 50%
*/
readonly minHealthyPercent?: number;
/**
* The maximum number of tasks, specified as a percentage of
* the Amazon ECS service's DesiredCount value, that can run
* in a service during a deployment.
*
* @default - 200%
*/
readonly maxHealthyPercent?: number;
}
/**
* A Fargate service running on an ECS cluster fronted by a network load balancer.
*/
export declare class NetworkMultipleTargetGroupsFargateService extends NetworkMultipleTargetGroupsServiceBase {
/**
* Uniquely identifies this class.
*/
static readonly PROPERTY_INJECTION_ID: string;
/**
* Determines whether the service will be assigned a public IP address.
*/
readonly assignPublicIp: boolean;
/**
* The Fargate service in this construct.
*/
readonly service: FargateService;
/**
* The Fargate task definition in this construct.
*/
readonly taskDefinition: FargateTaskDefinition;
/**
* The default target group for the service.
* @deprecated - Use `targetGroups` instead.
*/
readonly targetGroup: NetworkTargetGroup;
/**
* Constructs a new instance of the NetworkMultipleTargetGroupsFargateService class.
*/
constructor(scope: Construct, id: string, props?: NetworkMultipleTargetGroupsFargateServiceProps);
private createFargateService;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,70 @@
import type { Construct } from 'constructs';
import type * as ec2 from '../../../aws-ec2';
import type { HealthCheck } from '../../../aws-ecs';
import { FargateService, FargateTaskDefinition } from '../../../aws-ecs';
import type { Duration } from '../../../core';
import type { FargateServiceBaseProps } from '../base/fargate-service-base';
import type { QueueProcessingServiceBaseProps } from '../base/queue-processing-service-base';
import { QueueProcessingServiceBase } from '../base/queue-processing-service-base';
/**
* The properties for the QueueProcessingFargateService service.
*/
export interface QueueProcessingFargateServiceProps extends QueueProcessingServiceBaseProps, FargateServiceBaseProps {
/**
* Optional name for the container added.
* This name is not used when `taskDefinition` is provided.
*
* @default - QueueProcessingContainer
*/
readonly containerName?: string;
/**
* The health check command and associated configuration parameters for the container.
*
* @default - Health check configuration from container.
*/
readonly healthCheck?: HealthCheck;
/**
* The subnets to associate with the service.
*
* @default - Public subnets if `assignPublicIp` is set, otherwise the first available one of Private, Isolated, Public, in that order.
*/
readonly taskSubnets?: ec2.SubnetSelection;
/**
* The security groups to associate with the service. If you do not specify a security group, a new security group is created.
*
* @default - A new security group is created.
*/
readonly securityGroups?: ec2.ISecurityGroup[];
/**
* Specifies whether the task's elastic network interface receives a public IP address.
*
* If true, each task will receive a public IP address.
*
* @default false
*/
readonly assignPublicIp?: boolean;
/**
* The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy
* Elastic Load Balancing target health checks after a task has first started.
*
* @default - defaults to 60 seconds if at least one load balancer is in-use and it is not already set
*/
readonly healthCheckGracePeriod?: Duration;
}
/**
* Class to create a queue processing Fargate service
*/
export declare class QueueProcessingFargateService extends QueueProcessingServiceBase {
/**
* The Fargate service in this construct.
*/
readonly service: FargateService;
/**
* The Fargate task definition in this construct.
*/
readonly taskDefinition: FargateTaskDefinition;
/**
* Constructs a new instance of the QueueProcessingFargateService class.
*/
constructor(scope: Construct, id: string, props?: QueueProcessingFargateServiceProps);
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.QueueProcessingFargateService=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var aws_ecs_1=()=>{var tmp=require("../../../aws-ecs");return aws_ecs_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},cxapi=()=>{var tmp=require("../../../cx-api");return cxapi=()=>tmp,tmp},queue_processing_service_base_1=()=>{var tmp=require("../base/queue-processing-service-base");return queue_processing_service_base_1=()=>tmp,tmp};class QueueProcessingFargateService extends queue_processing_service_base_1().QueueProcessingServiceBase{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs_patterns.QueueProcessingFargateService",version:"2.252.0"};service;taskDefinition;constructor(scope,id,props={}){super(scope,id,props);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_patterns_QueueProcessingFargateServiceProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,QueueProcessingFargateService),error}if(props.taskDefinition&&props.image)throw new(core_1()).ValidationError((0,literal_string_1().lit)`SpecifyOneTaskDefinitionImage`,"You must specify only one of taskDefinition or image",this);if(props.taskDefinition)this.taskDefinition=props.taskDefinition;else if(props.image){this.taskDefinition=new(aws_ecs_1()).FargateTaskDefinition(this,"QueueProcessingTaskDef",{memoryLimitMiB:props.memoryLimitMiB||512,cpu:props.cpu||256,ephemeralStorageGiB:props.ephemeralStorageGiB,family:props.family,runtimePlatform:props.runtimePlatform});const containerName=props.containerName??"QueueProcessingContainer";this.taskDefinition.addContainer(containerName,{image:props.image,command:props.command,environment:this.environment,secrets:this.secrets,logging:this.logDriver,healthCheck:props.healthCheck})}else throw new(core_1()).ValidationError((0,literal_string_1().lit)`SpecifyOneTaskDefinitionImage`,"You must specify one of: taskDefinition or image",this);const desiredCount=core_1().FeatureFlags.of(this).isEnabled(cxapi().ECS_REMOVE_DEFAULT_DESIRED_COUNT)?void 0:this.desiredCount;this.service=new(aws_ecs_1()).FargateService(this,"QueueProcessingFargateService",{cluster:this.cluster,desiredCount,taskDefinition:this.taskDefinition,serviceName:props.serviceName,minHealthyPercent:props.minHealthyPercent,maxHealthyPercent:props.maxHealthyPercent,propagateTags:props.propagateTags,enableECSManagedTags:props.enableECSManagedTags,platformVersion:props.platformVersion,deploymentController:props.deploymentController,securityGroups:props.securityGroups,vpcSubnets:props.taskSubnets,assignPublicIp:props.assignPublicIp,circuitBreaker:props.circuitBreaker,capacityProviderStrategies:props.capacityProviderStrategies,enableExecuteCommand:props.enableExecuteCommand,healthCheckGracePeriod:props.healthCheckGracePeriod}),this.configureAutoscalingForService(this.service),this.grantPermissionsToService(this.service)}}exports.QueueProcessingFargateService=QueueProcessingFargateService;

View File

@@ -0,0 +1,60 @@
import type { Construct } from 'constructs';
import { FargateTaskDefinition } from '../../../aws-ecs';
import { EcsTask } from '../../../aws-events-targets';
import type { FargateServiceBaseProps } from '../base/fargate-service-base';
import type { ScheduledTaskBaseProps, ScheduledTaskImageProps } from '../base/scheduled-task-base';
import { ScheduledTaskBase } from '../base/scheduled-task-base';
/**
* The properties for the ScheduledFargateTask task.
*/
export interface ScheduledFargateTaskProps extends ScheduledTaskBaseProps, FargateServiceBaseProps {
/**
* The properties to define if using an existing TaskDefinition in this construct.
* ScheduledFargateTaskDefinitionOptions or ScheduledFargateTaskImageOptions must be defined, but not both.
*
* @default none
*/
readonly scheduledFargateTaskDefinitionOptions?: ScheduledFargateTaskDefinitionOptions;
/**
* The properties to define if the construct is to create a TaskDefinition.
* ScheduledFargateTaskDefinitionOptions or ScheduledFargateTaskImageOptions must be defined, but not both.
*
* @default none
*/
readonly scheduledFargateTaskImageOptions?: ScheduledFargateTaskImageOptions;
}
/**
* The properties for the ScheduledFargateTask using an image.
*/
export interface ScheduledFargateTaskImageOptions extends ScheduledTaskImageProps, FargateServiceBaseProps {
}
/**
* The properties for the ScheduledFargateTask using a task definition.
*/
export interface ScheduledFargateTaskDefinitionOptions {
/**
* The task definition to use for tasks in the service. Image or taskDefinition must be specified, but not both.
*
* [disable-awslint:ref-via-interface]
*
* @default - none
*/
readonly taskDefinition: FargateTaskDefinition;
}
/**
* A scheduled Fargate task that will be initiated off of CloudWatch Events.
*/
export declare class ScheduledFargateTask extends ScheduledTaskBase {
/**
* The Fargate task definition in this construct.
*/
readonly taskDefinition: FargateTaskDefinition;
/**
* The ECS task in this construct.
*/
readonly task: EcsTask;
/**
* Constructs a new instance of the ScheduledFargateTask class.
*/
constructor(scope: Construct, id: string, props: ScheduledFargateTaskProps);
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ScheduledFargateTask=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var aws_ecs_1=()=>{var tmp=require("../../../aws-ecs");return aws_ecs_1=()=>tmp,tmp},aws_events_targets_1=()=>{var tmp=require("../../../aws-events-targets");return aws_events_targets_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},scheduled_task_base_1=()=>{var tmp=require("../base/scheduled-task-base");return scheduled_task_base_1=()=>tmp,tmp};class ScheduledFargateTask extends scheduled_task_base_1().ScheduledTaskBase{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs_patterns.ScheduledFargateTask",version:"2.252.0"};taskDefinition;task;constructor(scope,id,props){super(scope,id,props);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_patterns_ScheduledFargateTaskProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,ScheduledFargateTask),error}if(props.scheduledFargateTaskDefinitionOptions&&props.scheduledFargateTaskImageOptions)throw new(core_1()).ValidationError((0,literal_string_1().lit)`SpecifyScheduledFargateTaskDefinition`,"You must specify either a scheduledFargateTaskDefinitionOptions or scheduledFargateTaskOptions, not both.",this);if(props.scheduledFargateTaskDefinitionOptions)this.taskDefinition=props.scheduledFargateTaskDefinitionOptions.taskDefinition;else if(props.scheduledFargateTaskImageOptions){const taskImageOptions=props.scheduledFargateTaskImageOptions,containerName=taskImageOptions.containerName??"ScheduledContainer";this.taskDefinition=new(aws_ecs_1()).FargateTaskDefinition(this,"ScheduledTaskDef",{memoryLimitMiB:taskImageOptions.memoryLimitMiB||512,cpu:taskImageOptions.cpu||256,ephemeralStorageGiB:taskImageOptions.ephemeralStorageGiB}),this.taskDefinition.addContainer(containerName,{image:taskImageOptions.image,command:taskImageOptions.command,environment:taskImageOptions.environment,secrets:taskImageOptions.secrets,logging:taskImageOptions.logDriver??this.createAWSLogDriver(this.node.id)})}else throw new(core_1()).ValidationError((0,literal_string_1().lit)`SpecifyOneTaskDefinitionImage`,"You must specify one of: taskDefinition or image",this);props.taskDefinition&&core_1().Annotations.of(this).addWarningV2("@aws-cdk/aws-ecs-patterns:propertyIgnored","Property 'taskDefinition' is ignored, use 'scheduledFargateTaskDefinitionOptions' or 'scheduledFargateTaskImageOptions' instead."),props.cpu&&core_1().Annotations.of(this).addWarningV2("@aws-cdk/aws-ecs-patterns:propertyIgnored","Property 'cpu' is ignored, use 'scheduledFargateTaskImageOptions.cpu' instead."),props.memoryLimitMiB&&core_1().Annotations.of(this).addWarningV2("@aws-cdk/aws-ecs-patterns:propertyIgnored","Property 'memoryLimitMiB' is ignored, use 'scheduledFargateTaskImageOptions.memoryLimitMiB' instead."),props.ephemeralStorageGiB&&core_1().Annotations.of(this).addWarningV2("@aws-cdk/aws-ecs-patterns:propertyIgnored","Property 'ephemeralStorageGiB' is ignored, use 'scheduledFargateTaskImageOptions.ephemeralStorageGiB' instead."),props.runtimePlatform&&core_1().Annotations.of(this).addWarningV2("@aws-cdk/aws-ecs-patterns:propertyIgnored","Property 'runtimePlatform' is ignored."),this.task=new(aws_events_targets_1()).EcsTask({cluster:this.cluster,taskDefinition:this.taskDefinition,taskCount:this.desiredTaskCount,subnetSelection:this.subnetSelection,platformVersion:props.platformVersion,securityGroups:props.securityGroups,propagateTags:props.propagateTags,tags:props.tags}),this.addTaskAsTarget(this.task)}}exports.ScheduledFargateTask=ScheduledFargateTask;