diff --git a/python/ecs/ecs-load-balanced-service/app.py b/python/ecs/ecs-load-balanced-service/app.py index 6fe05b078..0165f0b8e 100644 --- a/python/ecs/ecs-load-balanced-service/app.py +++ b/python/ecs/ecs-load-balanced-service/app.py @@ -28,7 +28,9 @@ def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: self, "Ec2Service", cluster=cluster, memory_limit_mib=512, - image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample") + task_image_options={ + 'image': ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample") + } ) core.CfnOutput( diff --git a/python/ecs/fargate-load-balanced-service/app.py b/python/ecs/fargate-load-balanced-service/app.py index bcc711da0..2ba4e54fe 100644 --- a/python/ecs/fargate-load-balanced-service/app.py +++ b/python/ecs/fargate-load-balanced-service/app.py @@ -26,7 +26,9 @@ def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: fargate_service = ecs_patterns.NetworkLoadBalancedFargateService( self, "FargateService", cluster=cluster, - image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample") + task_image_options={ + 'image': ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample") + } ) core.CfnOutput( diff --git a/python/ecs/fargate-service-with-autoscaling/app.py b/python/ecs/fargate-service-with-autoscaling/app.py index 023f5dd15..36e6759c7 100644 --- a/python/ecs/fargate-service-with-autoscaling/app.py +++ b/python/ecs/fargate-service-with-autoscaling/app.py @@ -26,7 +26,9 @@ def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: fargate_service = ecs_patterns.NetworkLoadBalancedFargateService( self, "sample-app", cluster=cluster, - image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample") + task_image_options={ + 'image': ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample") + } ) # Setup AutoScaling policy diff --git a/typescript/ecs/ecs-load-balanced-service/index.ts b/typescript/ecs/ecs-load-balanced-service/index.ts index eefbd1a19..2092efe27 100644 --- a/typescript/ecs/ecs-load-balanced-service/index.ts +++ b/typescript/ecs/ecs-load-balanced-service/index.ts @@ -21,7 +21,9 @@ class BonjourECS extends cdk.Stack { const ecsService = new ecs_patterns.NetworkLoadBalancedEc2Service(this, "Ec2Service", { cluster, memoryLimitMiB: 512, - image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), + taskImageOptions: { + image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), + } }); // Output the DNS where you can access your service diff --git a/typescript/ecs/fargate-load-balanced-service/index.ts b/typescript/ecs/fargate-load-balanced-service/index.ts index bc91d5e5a..488a5089f 100644 --- a/typescript/ecs/fargate-load-balanced-service/index.ts +++ b/typescript/ecs/fargate-load-balanced-service/index.ts @@ -15,7 +15,9 @@ class BonjourFargate extends cdk.Stack { // Instantiate Fargate Service with just cluster and image const fargateService = new ecs_patterns.NetworkLoadBalancedFargateService(this, "FargateService", { cluster, - image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), + taskImageOptions: { + image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), + }, }); // Output the DNS where you can access your service diff --git a/typescript/ecs/fargate-service-with-auto-scaling/index.ts b/typescript/ecs/fargate-service-with-auto-scaling/index.ts index 9413fbc11..b7a11cbb0 100644 --- a/typescript/ecs/fargate-service-with-auto-scaling/index.ts +++ b/typescript/ecs/fargate-service-with-auto-scaling/index.ts @@ -14,7 +14,9 @@ class AutoScalingFargateService extends cdk.Stack { // Create Fargate Service const fargateService = new ecs_patterns.NetworkLoadBalancedFargateService(this, 'sample-app', { cluster, - image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample") + taskImageOptions: { + image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample") + }, }); // Setup AutoScaling policy diff --git a/typescript/ecs/fargate-service-with-local-image/index.ts b/typescript/ecs/fargate-service-with-local-image/index.ts index e2148428a..01b1946e0 100644 --- a/typescript/ecs/fargate-service-with-local-image/index.ts +++ b/typescript/ecs/fargate-service-with-local-image/index.ts @@ -12,13 +12,15 @@ const stack = new cdk.Stack(app, 'FargateServiceWithLocalImage'); const vpc = new ec2.Vpc(stack, 'MyVpc', { maxAzs: 2 }); const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); -// Instantiate Fargate Service with a cluster and a local image that gets +// Instantiate Fargate Service with a cluster and a local image that gets // uploaded to an S3 staging bucket prior to being uploaded to ECR. // A new repository is created in ECR and the Fargate service is created // with the image from ECR. new ecs_patterns.NetworkLoadBalancedFargateService(stack, "FargateService", { cluster, - image: ecs.ContainerImage.fromAsset(path.resolve(__dirname, 'local-image')) + taskImageOptions: { + image: ecs.ContainerImage.fromAsset(path.resolve(__dirname, 'local-image')) + } }); app.synth();