Question

Difficulty: MediumAuto Scaling and Elastic Load Balancing (ELB)

A company hosts a web application on Amazon EC2 instances within an Auto Scaling group (ASG) behind an Application Load Balancer (ALB). The ASG is configured with default settings. During a minor software failure, the web server process on one of the EC2 instances crashes. The ALB target group health checks correctly identify the instance as unhealthy and stop routing user traffic to it. However, the ASG does not terminate or replace the unhealthy instance, leading to reduced capacity. Which action should a solutions architect take to ensure the unhealthy instance is automatically replaced?

  1. A
    Implement an Amazon Route 53 latency-based routing policy with health checks to route traffic away from the instance and notify the Auto Scaling group.
  2. B
    Update the Application Load Balancer target group health check to monitor the default port 80 instead of the application's actual port.
  3. Configure the Auto Scaling group to use Elastic Load Balancing (ELB) health checks instead of the default EC2 health checks.Answer
  4. D
    Configure a stateless Network ACL on the public subnet to explicitly deny inbound traffic to the instance when the application crashes.

Answer

Configure the Auto Scaling group to use Elastic Load Balancing (ELB) health checks instead of the default EC2 health checks.
By default, an Amazon EC2 Auto Scaling group only monitors EC2 status checks (which evaluate hypervisor and hardware health). If a web server process crashes but the OS is still running, the EC2 status checks will succeed. Configuring the Auto Scaling group to use Elastic Load Balancing (ELB) health checks forces the ASG to terminate and replace instances that fail the Application Load Balancer's target group health checks, maintaining application availability.

Step-by-Step Solution

1
Analyze the default behavior of the Auto Scaling group (ASG) health check mechanism.
By default, the ASG only uses EC2 status checks. Since the instance OS remains active and running during a web server application crash, the EC2 status check passes, and the ASG considers the instance healthy.
Understanding why the ASG does not automatically replace the instance is key to identifying the correct corrective configuration.
2
Determine how the Application Load Balancer (ALB) health checks behave.
The ALB performs application-level health checks (e.g., HTTP/HTTPS requests to a health path). It correctly identifies the instance as unhealthy and stops routing user traffic to it.
Since the load balancer already has the correct application health state, this state must be communicated to the ASG.
3
Modify the ASG health check type to integrate with the ALB.
Changing the ASG health check configuration from 'EC2' to 'ELB' allows the ASG to receive health status updates from the load balancer's target groups, terminating and replacing any instances marked unhealthy by the load balancer.
This configuration bridges the gap between application-level health status and instance lifecycle management.

Key Concept

Auto Scaling Group Health Check Integration with Elastic Load Balancing
Estimated Time:1m 30s
Rate this question