Advertisement
Intermediate AWS, Auto Scaling Groups

How do health checks work within an Auto Scaling Group to maintain a healthy fleet of instances?

Short answer

An Auto Scaling Group continuously monitors the health of its instances using either EC2 status checks or, if configured, Elastic Load Balancer health checks, and whenever an instance is found to be unhealthy, the Auto Scaling Group automatically terminates that instance and…

Save AWS mock interview
Advertisement
AModel answer
An Auto Scaling Group continuously monitors the health of its instances using either EC2 status checks or, if configured, Elastic Load Balancer health checks, and whenever an instance is found to be unhealthy, the Auto Scaling Group automatically terminates that instance and launches a replacement, ensuring the group always maintains its desired capacity of healthy, functioning instances.
Example

aws autoscaling update-auto-scaling-group --auto-scaling-group-name my-asg --health-check-type ELB --health-check-grace-period 300

Real-world example
A web application configures its Auto Scaling Group to use Elastic Load Balancer health checks rather than basic EC2 checks, ensuring that instances failing to respond correctly to application level requests are replaced even if the underlying EC2 instance itself appears technically healthy.
Likely follow-ups
  • What is the health check grace period and why is it needed?
  • What is the difference between EC2 status checks and ELB health checks?
Related topics