Adding Elastic Load Balancing health checks to an Auto Scaling group - Amazon EC2 Auto Scaling

Adding Elastic Load Balancing health checks to an Auto Scaling group

The default health checks for an Auto Scaling group are EC2 status checks only. If an instance fails these status checks, it is marked unhealthy and is terminated while Amazon EC2 Auto Scaling launches a new replacement instance.

You can attach one or more load balancer target groups, one or more Classic Load Balancers, or both to your Auto Scaling group. However, by default, the Auto Scaling group does not consider an instance unhealthy and replace it if it fails the Elastic Load Balancing health checks.

To ensure that your Auto Scaling group can determine instance health based on additional load balancer tests, configure the Auto Scaling group to use Elastic Load Balancing (ELB) health checks. The load balancer periodically sends pings, attempts connections, or sends requests to test the EC2 instances and determines if an instance is unhealthy. If you configure the Auto Scaling group to use Elastic Load Balancing health checks, it considers the instance unhealthy if it fails either the EC2 status checks or the Elastic Load Balancing health checks. If you attach multiple load balancer target groups or Classic Load Balancers to the group, all of them must report that an instance is healthy in order for it to consider the instance healthy. If any one of them reports an instance as unhealthy, the Auto Scaling group replaces the instance, even if others report it as healthy.

Add Elastic Load Balancing health checks

Use the following procedure to add Elastic Load Balancing (ELB) health checks to an Auto Scaling group.

To add Elastic Load Balancing health checks

  1. Open the Amazon EC2 Auto Scaling console at https://console.aws.amazon.com/ec2autoscaling/.

  2. Select the check box next to an existing group.

    A split pane opens up in the bottom part of the Auto Scaling groups page, showing information about the group that's selected.

  3. On the Details tab, choose Health checks, Edit.

  4. For Health check type, select Enable ELB health checks.

  5. For Health check grace period, enter the amount of time, in seconds, that Amazon EC2 Auto Scaling needs to wait before checking the health status of an instance. New instances often need time for a brief warm-up before they can pass a health check. To provide enough warm-up time, set the health check grace period of the group to match the expected startup time of your application.

  6. Choose Update.

  7. On the Instance management tab, under Instances, you can view the health status of instances. The Health Status column displays the results of the newly added health checks.

See also