AWS › Auto Scaling Groups
How do health checks work within an Auto Scaling Group to maintain a healthy fleet of instances?
IntermediateAnswer
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.
aws autoscaling update-auto-scaling-group --auto-scaling-group-name my-asg --health-check-type ELB --health-check-grace-period 300Real-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.