Menu
Auto Scaling
User Guide

Using ELB Health Checks with Auto Scaling

An Auto Scaling group periodically checks the health status of each instance. It can use EC2 status checks only, or EC2 status checks plus Elastic Load Balancing health checks. If Auto Scaling determines that an instance is unhealthy, it replaces the instance.

If you configure an Auto Scaling group to determine health status using EC2 status checks only, which is the default, Auto Scaling considers the instance unhealthy if it fails the EC2 status checks. However, if you have attached one or more load balancers or target groups to the Auto Scaling group and a load balancer reports that an instance is unhealthy, Auto Scaling does not consider the instance unhealthy and therefore it does not replace it.

If you configure your Auto Scaling group to determine health status using both EC2 status checks and Elastic Load Balancing health checks, Auto Scaling considers the instance unhealthy if it fails either the status checks or the health check. Note that if you attach multiple load balancers to an Auto Scaling group, all of them must report that the instance is healthy in order for Auto Scaling to consider the instance healthy. If one load balancer reports an instance as unhealthy, Auto Scaling replaces the instance, even if other load balancers report it as healthy.

For more information, see Health Checks for Auto Scaling Instances.

Adding Health Checks Using the Console

Use the following procedure to add an ELB health check with a grace period of 300 seconds to an Auto Scaling group with an attached load balancer.

To add health checks using the console

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. On the navigation pane, under Auto Scaling, choose Auto Scaling Groups.

  3. Select your group.

  4. On the Details tab, choose Edit.

  5. For Health Check Type, select ELB.

  6. For Health Check Grace Period, enter 300.

  7. Choose Save.

  8. On the Instances tab, the Health Status column displays the results of the newly added health checks.

Adding Health Checks Using the AWS CLI

Use the following update-auto-scaling-group command to create a health check with a grace period of 300 seconds:

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