Commit 69b9c03
authored
fix(ecs-patterns): resolve target group conflict when updating ALB internetFacing or loadBalancerName (under feature flag) (#35508)
fix(ecs-patterns): resolve target group conflict when switching ALB public/private
Fixes #33253
### Issue # (if applicable)
Closes #33253.
### Reason for this change
When switching ApplicationLoadBalancedFargateService from public to private (or vice versa), CloudFormation fails with "target group cannot be associated with more than one load balancer" error. This happens because both old and new load balancers try to use the same target group during replacement.
Updating the `loadBalancerName` of ApplicationLoadBalancedFargateService can also trigger the same issue.
### Description of changes
Modified target group naming in `ApplicationLoadBalancedServiceBase` to include the load balancer type and name. e.g:
- Public load balancer: target group named "ECS"
- Private load balancer: target group named "ECSPrivate"
- Private load balancer with name "Foo": target group named "ECSFooPrivate"
This ensures each load balancer gets its own target group, preventing conflicts during CloudFormation updates.
## 1 parent 77331f1 commit 69b9c03
File tree
21 files changed
+3752
-1248
lines changed- packages
- @aws-cdk-testing/framework-integ/test
- aws-ecs-patterns/test/fargate
- integ.alb-fargate-service-public-private-switch.js.snapshot
- aws-elasticloadbalancingv2-targets/test/integ.alb-target.js.snapshot
- aws-cdk-lib
- aws-ecs-patterns
- lib/base
- test/fargate
- cx-api
- lib
21 files changed
+3752
-1248
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments