Skip to content

Commit 894f052

Browse files
netroymergify[bot]
authored andcommitted
1 parent c8bf5ff commit 894f052

File tree

7 files changed

+22
-8
lines changed
  • python/ecs
    • ecs-load-balanced-service
    • fargate-load-balanced-service
    • fargate-service-with-autoscaling
  • typescript/ecs

7 files changed

+22
-8
lines changed

python/ecs/ecs-load-balanced-service/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
2828
self, "Ec2Service",
2929
cluster=cluster,
3030
memory_limit_mib=512,
31-
image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
31+
task_image_options={
32+
'image': ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
33+
}
3234
)
3335

3436
core.CfnOutput(

python/ecs/fargate-load-balanced-service/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
2626
fargate_service = ecs_patterns.NetworkLoadBalancedFargateService(
2727
self, "FargateService",
2828
cluster=cluster,
29-
image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
29+
task_image_options={
30+
'image': ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
31+
}
3032
)
3133

3234
core.CfnOutput(

python/ecs/fargate-service-with-autoscaling/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
2626
fargate_service = ecs_patterns.NetworkLoadBalancedFargateService(
2727
self, "sample-app",
2828
cluster=cluster,
29-
image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
29+
task_image_options={
30+
'image': ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
31+
}
3032
)
3133

3234
# Setup AutoScaling policy

typescript/ecs/ecs-load-balanced-service/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ class BonjourECS extends cdk.Stack {
2121
const ecsService = new ecs_patterns.NetworkLoadBalancedEc2Service(this, "Ec2Service", {
2222
cluster,
2323
memoryLimitMiB: 512,
24-
image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
24+
taskImageOptions: {
25+
image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
26+
}
2527
});
2628

2729
// Output the DNS where you can access your service

typescript/ecs/fargate-load-balanced-service/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ class BonjourFargate extends cdk.Stack {
1515
// Instantiate Fargate Service with just cluster and image
1616
const fargateService = new ecs_patterns.NetworkLoadBalancedFargateService(this, "FargateService", {
1717
cluster,
18-
image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
18+
taskImageOptions: {
19+
image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
20+
},
1921
});
2022

2123
// Output the DNS where you can access your service

typescript/ecs/fargate-service-with-auto-scaling/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ class AutoScalingFargateService extends cdk.Stack {
1414
// Create Fargate Service
1515
const fargateService = new ecs_patterns.NetworkLoadBalancedFargateService(this, 'sample-app', {
1616
cluster,
17-
image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample")
17+
taskImageOptions: {
18+
image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample")
19+
},
1820
});
1921

2022
// Setup AutoScaling policy

typescript/ecs/fargate-service-with-local-image/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ const stack = new cdk.Stack(app, 'FargateServiceWithLocalImage');
1212
const vpc = new ec2.Vpc(stack, 'MyVpc', { maxAzs: 2 });
1313
const cluster = new ecs.Cluster(stack, 'Cluster', { vpc });
1414

15-
// Instantiate Fargate Service with a cluster and a local image that gets
15+
// Instantiate Fargate Service with a cluster and a local image that gets
1616
// uploaded to an S3 staging bucket prior to being uploaded to ECR.
1717
// A new repository is created in ECR and the Fargate service is created
1818
// with the image from ECR.
1919
new ecs_patterns.NetworkLoadBalancedFargateService(stack, "FargateService", {
2020
cluster,
21-
image: ecs.ContainerImage.fromAsset(path.resolve(__dirname, 'local-image'))
21+
taskImageOptions: {
22+
image: ecs.ContainerImage.fromAsset(path.resolve(__dirname, 'local-image'))
23+
}
2224
});
2325

2426
app.synth();

0 commit comments

Comments
 (0)