Add 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
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/
, and choose Auto Scaling Groups from the navigation pane. -
Select the check box next to an existing group.
A split pane opens up in the bottom of the Auto Scaling groups page.
-
On the Details tab, choose Health checks, Edit.
-
For Health check type, select Enable ELB health checks.
-
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 after it enters the
InService
state. For more information, see Set the health check grace period for an Auto Scaling group. -
Choose Update.
-
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
-
For more information, see Health checks for Auto Scaling instances.
-
To configure health checks for your Application Load Balancer, see Health checks for your target groups in the User Guide for Application Load Balancers.
-
To configure health checks for your Network Load Balancer, see Health checks for your target groups in the User Guide for Network Load Balancers.
-
To configure health checks for your Gateway Load Balancer, see Health checks for your target groups in the User Guide for Gateway Load Balancers.
-
To configure health checks for your Classic Load Balancer, see Configure health checks for your Classic Load Balancer in the User Guide for Classic Load Balancers.