diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/queue-processing-service-base.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/queue-processing-service-base.ts index e3e4884d4a631..02d6c75ae1891 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/queue-processing-service-base.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/queue-processing-service-base.ts @@ -2,7 +2,7 @@ import { Construct } from 'constructs'; import { ScalingInterval } from '../../../aws-applicationautoscaling'; import { IVpc } from '../../../aws-ec2'; import { - AwsLogDriver, BaseService, CapacityProviderStrategy, Cluster, ContainerImage, DeploymentController, DeploymentCircuitBreaker, + AwsLogDriver, BaseService, CapacityProviderStrategy, Cluster, DeploymentController, DeploymentCircuitBreaker, ICluster, LogDriver, PropagatedTagSource, Secret, } from '../../../aws-ecs'; import { IQueue, Queue } from '../../../aws-sqs'; @@ -36,12 +36,6 @@ export interface QueueProcessingServiceBaseProps { */ readonly vpc?: IVpc; - /** - * The image used to start a container. - * Image or taskDefinition must be specified, but not both. - */ - readonly image?: ContainerImage; - /** * The command that is passed to the container. * diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/ecs/queue-processing-ecs-service.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/ecs/queue-processing-ecs-service.ts index fa53d91f0898d..8a9b8983455a2 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/ecs/queue-processing-ecs-service.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/ecs/queue-processing-ecs-service.ts @@ -1,5 +1,5 @@ import { Construct } from 'constructs'; -import { Ec2Service, Ec2TaskDefinition, PlacementConstraint, PlacementStrategy } from '../../../aws-ecs'; +import { ContainerImage, Ec2Service, Ec2TaskDefinition, PlacementConstraint, PlacementStrategy } from '../../../aws-ecs'; import { FeatureFlags } from '../../../core'; import * as cxapi from '../../../cx-api'; import { QueueProcessingServiceBase, QueueProcessingServiceBaseProps } from '../base/queue-processing-service-base'; @@ -8,6 +8,12 @@ import { QueueProcessingServiceBase, QueueProcessingServiceBaseProps } from '../ * The properties for the QueueProcessingEc2Service service. */ export interface QueueProcessingEc2ServiceProps extends QueueProcessingServiceBaseProps { + /** + * The image used to start a container. + * + */ + readonly image: ContainerImage; + /** * The number of cpu units used by the task. * diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts index 7eb5886c6e3ee..adac20f8e5551 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts @@ -1,6 +1,6 @@ import { Construct } from 'constructs'; import * as ec2 from '../../../aws-ec2'; -import { FargateService, FargateTaskDefinition, HealthCheck } from '../../../aws-ecs'; +import { ContainerImage, FargateService, FargateTaskDefinition, HealthCheck } from '../../../aws-ecs'; import { FeatureFlags } from '../../../core'; import * as cxapi from '../../../cx-api'; import { FargateServiceBaseProps } from '../base/fargate-service-base'; @@ -10,6 +10,14 @@ import { QueueProcessingServiceBase, QueueProcessingServiceBaseProps } from '../ * The properties for the QueueProcessingFargateService service. */ export interface QueueProcessingFargateServiceProps extends QueueProcessingServiceBaseProps, FargateServiceBaseProps { + /** + * The image used to start a container. + * Image or taskDefinition must be specified, but not both. + * + * @default - none + */ + readonly image?: ContainerImage; + /** * Optional name for the container added. * This name is not used when `taskDefinition` is provided. @@ -65,7 +73,7 @@ export class QueueProcessingFargateService extends QueueProcessingServiceBase { /** * Constructs a new instance of the QueueProcessingFargateService class. */ - constructor(scope: Construct, id: string, props: QueueProcessingFargateServiceProps) { + constructor(scope: Construct, id: string, props: QueueProcessingFargateServiceProps = {}) { super(scope, id, props); if (props.taskDefinition != null && props.image != null) {