ApplicationLoadBalancedEc2Service allows 0.0.0.0/0 for listenerPort, and no way to remove it #8342
Labels
@aws-cdk/aws-ecs
Related to Amazon Elastic Container
@aws-cdk/aws-ecs-patterns
Related to ecs-patterns library
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p1
When creating an ApplicationLoadBalancedEc2Service, the resulting Security Group allows 0.0.0.0/0 access for the specified listener port and there is no way to remove it. This happens even if you provide an ApplicationLoadBalancer directly.
It appears to be related to the fact that you can't set "open" on the listener created: https://github.com/aws/aws-cdk/blob/v1.42.1/packages/%40aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts#L186-L188
Reproduction Steps
Create an ApplicationLoadBalancedEC2Service
View the security group after synthesize.
Error Log
No error log.
Environment
Other
This should be called out in the documentation.
Also, there should be a way to specify that the listenerPort in the construct not include 0.0.0.0/0 so that it can be specified directly.
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: