aws-ecs-patterns: ApplicationLoadBalancedEc2Service doesn't set SecurityGroups properly, so that ALB can't reach to container #26970
Labels
@aws-cdk/aws-ecs-patterns
Related to ecs-patterns library
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
Describe the bug
If I use
ec2.Cluster
imported from another stack with ApplicationLoadBalancedEc2Service, not reachable from ALB to the container and will have unhealthy status.There are two causes:
The SecurityGroup of EC2 instance doesn't allow any incoming traffic. Should allow the port range used for ALB dynamic port mapping.
The SecurityGroup of ALB doesn't allow any outgoing TCP traffic. Should allow all TCP traffic(maybe, but at least should allow something).
Expected Behavior
The SecurityGroups of EC2 instance and ALB are configured properly without additional coding, or the documentation is written to properly configure them.
Current Behavior
ALB can't see the ECS containers and recognizes them as unhealthy.
Reproduction Steps
Deploying with the following code reproduces the situation.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.93.0 (build 724bd01)
Framework Version
No response
Node.js Version
2.93.0
OS
Linux acm-envy3-win 5.15.90.4-microsoft-standard-WSL2 #1 SMP Tue Jul 18 21:28:32 UTC 2023 x86_64 GNU/Linux
Language
Typescript
Language Version
5.2.2
Other information
No response
The text was updated successfully, but these errors were encountered: