Auto scaling groups associated with a load balancer should use ELB health checks
Checks that an Auto Scaling group attached to a Classic Load Balancer or a target group uses ELB health checks, so instances the load balancer reports unhealthy are replaced, not only those failing EC2 status checks. A group with no load balancer attached passes.
- service
- AutoScaling
- severity
- Low
- scope
- evaluated in every region
How to fix it
- Interrupts service: Auto Scaling then replaces any instance the load balancer reports unhealthy, so confirm the target group's health check passes before turning this on.
In the console
EC2 → Auto Scaling Groups → the group → Details → Health checks
- Turn on Elastic Load Balancing health checks
- Selected
- Health check grace period
- 300 seconds, or as long as an instance takes to pass the load balancer's health check
With the AWS CLI
- Overwrites existing settings: The --health-check-type value replaces the group's whole list of types, so write EBS,ELB if Amazon EBS health checks are on as well.
aws autoscaling update-auto-scaling-group --auto-scaling-group-name <group-name> --health-check-type ELB --health-check-grace-period 300 --region <region>With Terraform
resource "aws_autoscaling_group" "this" {
name = var.asg_name
min_size = var.min_size
max_size = var.max_size
health_check_type = "ELB"
health_check_grace_period = 300
launch_template {
id = aws_launch_template.this.id
version = "$Default"
}
}
See which of your accounts this check is failing on.
Book a live scan