A company hosts a customer-facing web application on Amazon EC2 instances managed by an Auto Scaling group (ASG). The instances are registered with a target group of an Application Load Balancer (ALB). The web application serves user requests on HTTP port 80. However, the application's health status service runs on a dedicated management agent listening on TCP port 8080. The target group health check is configured to query port 8080. Currently, the security group for the EC2 instances allows inbound HTTP traffic on port 80 from the ALB security group. The ALB console reports all EC2 instances as unhealthy, and users are receiving 502 Bad Gateway errors.
Which action should the Solutions Architect take to resolve the issue?
- Modify the security group of the EC2 instances to allow inbound traffic on TCP port 8080 from the security group of the ALB.Answer
- BModify the subnet Network ACL to allow inbound traffic on port 8080, as security groups are stateless and cannot track the return traffic for the health checks.
- CChange the target group health check port setting to 'traffic-port' so that the health check automatically queries port 80.
- DConfigure an Amazon Route 53 latency routing policy to route client traffic directly to the elastic network interfaces (ENIs) of the EC2 instances.
Answer
Modify the security group of the EC2 instances to allow inbound traffic on TCP port 8080 from the security group of the ALB.
The correct action is to modify the security group of the EC2 instances to allow inbound traffic on TCP port 8080 from the security group of the ALB. Since the target group health check is configured to query port 8080 but the EC2 instances' security group only allows inbound traffic on port 80, the ALB's health check requests are blocked. Enabling port 8080 inbound allows the ALB to reach the health status service, marking the instances as healthy and resolving the service outage.
Step-by-Step Solution
Key Concept
Auto Scaling and Elastic Load Balancing (ELB) Health Check and Security Group Integration