aws_ecs_patterns: ApplicationLoadBalancedFargateService does not allow multiple services to connect to the same load balancer #32958
Labels
@aws-cdk/aws-ecs-patterns
Related to ecs-patterns library
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Describe the bug
(Reopening of #24975)
The
ApplicationLoadBalancedFargateService
andApplicationLoadBalancedServiceBase
classes do not allow for multiple services to be created against the same load balancer. An example repo is https://gitlab.com/bytesnz/fargate-services-fail/-/blob/main/index.ts#L47 based off https://github.com/aws-samples/aws-cdk-examples/tree/main/typescript/application-load-balancer. The cause is a hardcoded name for the listener ofPublicListener
.Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
ApplicationLoadBalancedFargateService
andApplicationLoadBalancedServiceBase
classes use a unique name for the listener and cdk synth generates that stack correctly and stack is able to be deployedCurrent Behavior
cdk synth throws an error
Reproduction Steps
Possible Solution
I was wondering if the id could be something like
id + 'Listener'
instead of'PublicListener'
. Can do a PR for, but there are a few other ids that might need the same treatment.Additional Information/Context
No response
CDK CLI Version
2.175.1
Framework Version
2.175.1
Node.js Version
22
OS
Ubuntu
Language
TypeScript
Language Version
5.1.6
Other information
No response
The text was updated successfully, but these errors were encountered: