AWS Auto Scaling allows the user to scale the Amazon EC2 computer resources up or down automatically as per the defined conditions. Auto Scaling ensures that all the running instances are healthy by performing periodic health checks. Auto Scaling is resilient as it will automatically terminate the unhealthy instance and launch a new healthy instance, thereby maintaining the number of running instances as per the configuration and condition.
The present guide demonstrates how to configure a health check for ELB and mark an instance as unhealthy. Since AWS does not provide the management console for Auto Scaling, all the tasks would be performed by CLI.
Auto Scaling checks the health of the EC2 instances by doing status checks periodically. By default the health check is configured for the EC2 instances only. If Auto Scaling is configured with ELB, the user can also configure the health check to be performed for ELB. In this case, Auto Scaling will perform the health check for both ELB and the instances. If the status returned from the EC2 health check is any status other than “OK” and for ELB it is any status other than “In Service”, Auto Scaling will mark that instance or ELB is unhealthy. If an ELB is unhealthy, all its instances will also be marked as unhealthy.