An organization has migrated a legacy internal API to run on Amazon EC2 instances in an Auto Scaling Group (ASG) behind an Application Load Balancer (ALB). The API service is bound to TCP port 5050 on the instances. After launching the new instances, the ALB reports all targets as unhealthy with a status of 502 Bad Gateway for client requests. The security group associated with the ALB allows traffic on port 443 from client networks. The instances are deployed in private subnets. Which configuration adjustments are required to restore service health and enable successful load balancing? (Select two.)
- Configure the security group of the EC2 instances to permit inbound TCP port 5050 traffic from the security group of the Application Load Balancer.Answer
- Update the ALB's target group settings to register targets on port 5050 and configure health checks to query the traffic port or port 5050.Answer
- CAdjust the health check path in the target group to point to the default port 80 so that health monitoring is isolated from custom application ports.
- DAdd a stateless rule to the Network Access Control List (Network ACL) of the instance subnets that redirects inbound TCP port 80 traffic to TCP port 5050.
- EImplement an Amazon Route 53 latency routing policy that redirects traffic directly to the individual EC2 instance IP addresses when the ALB health checks fail.
Answer
Configure the security group of the EC2 instances to allow inbound traffic on TCP port 5050 from the ALB's security group, and update the ALB's target group settings to register targets on port 5050 and configure health checks to query port 5050.
To resolve the 502 Bad Gateway errors, the Application Load Balancer must be able to successfully connect to the EC2 instances on their active service port. This requires two configurations: first, updating the target group to send both application traffic and health checks to port 5050; second, modifying the security group of the EC2 instances to allow inbound TCP traffic on port 5050 from the ALB's security group.
Step-by-Step Solution
Key Concept
Configuring target group port registration, health checks, and security group rules for custom ports behind an Application Load Balancer.