Skip to content

Commit e7b755c

Browse files
garnaatrix0rrr
authored andcommitted
fix: Update Fargate LoadBalance Service examples (#126)
Update Fargate load balanced service example for TypeScript and Python based on aws/aws-cdk#3719.
1 parent 4078498 commit e7b755c

File tree

7 files changed

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

7 files changed

+7
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
2424
cluster.add_capacity("DefaultAutoScalingGroup",
2525
instance_type=ec2.InstanceType("t2.micro"))
2626

27-
ecs_service = ecs_patterns.LoadBalancedEc2Service(
27+
ecs_service = ecs_patterns.NetworkLoadBalancedEc2Service(
2828
self, "Ec2Service",
2929
cluster=cluster,
3030
memory_limit_mib=512,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
2323
vpc=vpc
2424
)
2525

26-
fargate_service = ecs_patterns.LoadBalancedFargateService(
26+
fargate_service = ecs_patterns.NetworkLoadBalancedFargateService(
2727
self, "FargateService",
2828
cluster=cluster,
2929
image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
2323
)
2424

2525
# Create Fargate Service
26-
fargate_service = ecs_patterns.LoadBalancedFargateService(
26+
fargate_service = ecs_patterns.NetworkLoadBalancedFargateService(
2727
self, "sample-app",
2828
cluster=cluster,
2929
image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class BonjourECS extends cdk.Stack {
1818
});
1919

2020
// Instantiate ECS Service with just cluster and image
21-
const ecsService = new ecs_patterns.LoadBalancedEc2Service(this, "Ec2Service", {
21+
const ecsService = new ecs_patterns.NetworkLoadBalancedEc2Service(this, "Ec2Service", {
2222
cluster,
2323
memoryLimitMiB: 512,
2424
image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class BonjourFargate extends cdk.Stack {
1313
const cluster = new ecs.Cluster(this, 'Cluster', { vpc });
1414

1515
// Instantiate Fargate Service with just cluster and image
16-
const fargateService = new ecs_patterns.LoadBalancedFargateService(this, "FargateService", {
16+
const fargateService = new ecs_patterns.NetworkLoadBalancedFargateService(this, "FargateService", {
1717
cluster,
1818
image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
1919
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class AutoScalingFargateService extends cdk.Stack {
1212
const cluster = new ecs.Cluster(this, 'fargate-service-autoscaling', { vpc });
1313

1414
// Create Fargate Service
15-
const fargateService = new ecs_patterns.LoadBalancedFargateService(this, 'sample-app', {
15+
const fargateService = new ecs_patterns.NetworkLoadBalancedFargateService(this, 'sample-app', {
1616
cluster,
1717
image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample")
1818
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const cluster = new ecs.Cluster(stack, 'Cluster', { vpc });
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.
19-
new ecs_patterns.LoadBalancedFargateService(stack, "FargateService", {
19+
new ecs_patterns.NetworkLoadBalancedFargateService(stack, "FargateService", {
2020
cluster,
2121
image: ecs.ContainerImage.fromAsset(path.resolve(__dirname, 'local-image'))
2222
});

0 commit comments

Comments
 (0)