AWS Official Blog

Elastic Load Balancer Health Checks

by Jeff Barr | on | in Amazon CloudWatch |

Auto Scaling can now take advantage of the instance health information collected by the associated Elastic Load Balancer.

Specifically, once a load balancer determines that an instance is unhealthy (using the health checks that were established when the load balancer was created), Auto Scaling can be instructed to terminate the unhealthy instances and to launch replacements. This is all done within the established Auto Scaling model using a TerminateInstance scaling activity followed by a LaunchInstance activity.

You can opt in to this behavior by setting a single property (HealthCheckType) on the Auto Scaling group associated with the load balancer. You can also use the HealthCheckGracePeriod property to defer health checks for newly created instances so that they have some time to fully initialize and start responding to health checks.

The SetInstanceHealth function can be used to integrate your own health check system with Auto Scaling. You can choose whether or this call honors the grace period or not: if you need to mark an instance unhealthy, by hand, you can ignore the grace period.  If you build an automated health check system, you will probably choose to honor it.

When you call DescribeAutoScalingGroups, you’ll be able to see which instances are healthy and which are not. The unhealthy instances will, of course, remain in the group for a very short time.

Next feature: Amazon CloudWatch Alarms.

– Jeff;