A company hosts a web application on Amazon EC2 instances within an Auto Scaling group (ASG) behind an Application Load Balancer (ALB). The solutions architect notices that when the application on an EC2 instance crashes and returns HTTP 5xx errors, the ALB marks the instance as unhealthy, but the ASG does not terminate or replace the instance. What configuration change should the solutions architect make to ensure that the ASG automatically replaces instances that fail the application-level health checks?
- AChange the target group health check port settings to query port 80, while the application server remains bound to port 8080.
- BConfigure a stateful rule in the subnet's Network Access Control List (NACL) to track and automatically allow return traffic for the health check requests.
- Configure the Auto Scaling group to use ELB health checks instead of EC2 health checks.Answer
- DReplace the Application Load Balancer with an Amazon Route 53 latency routing policy configured with health checks to route user traffic directly to the EC2 instances.
Answer
Configure the Auto Scaling group to use ELB health checks instead of EC2 health checks.
The correct action is to configure the Auto Scaling group (ASG) to use Elastic Load Balancing (ELB) health checks. By default, an ASG only monitors EC2 status checks (system and instance status). When the ELB health check type is enabled, the ASG monitors the health status of the instances in the target group. If the Application Load Balancer (ALB) marks an instance as unhealthy (e.g., due to failing application-level HTTP health checks), the ASG will automatically terminate and replace that instance, maintaining application availability.
Step-by-Step Solution
Key Concept
Auto Scaling Group Health Check Configuration