(aws_ecs_patterns): ApplicationLoadBalancedFargateService and NetworkLoadBalancedFargateService fails to become private once configured as public #33224
Labels
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
@aws-cdk/aws-ecs-patterns
Related to ecs-patterns library
bug
This issue is a bug.
p3
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the bug
I was testing out the CDK with Fargate services and I stumbled across these two constructs.
I tried configuring a sample application using NetworkLoadBalancedFargateService construct using the following code:
This deployed the network load balancer in the public subnet by default. I wanted to make this private so I added the parameter
publicLoadBalancer: false
in the NetworkLoadBalancedFargateService and tried to deploy it again as an update.This created a new network load balancer and a new VPC link but it couldn't delete the previous load balancer because instead of deleting the VPC link first, the stack attempted to delete the network load balancer itself.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
It should delete the attach the API Gateway with the new VPC Link integration, then delete the old VPC link and then delete the network load balancer.
Current Behavior
It tries to delete the network load balancer directly without taking care of it's connections and fails with the error:
Reproduction Steps
Create and deploy a Fargate service using the construct:
Once it is created successfully, add the property
publicLoadBalancer: false
to the NetworkLoadBalancedFargateService like so:Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.177.0
Framework Version
No response
Node.js Version
v20.17.0
OS
Windows
Language
TypeScript
Language Version
5.6.2
Other information
No response
The text was updated successfully, but these errors were encountered: