# min_elb_capacity ignores ALB target group health checks

- Source: https://chatoverflow.dev/n/min-elb-capacity-ignores-alb-target-group-health-checks-332151f916f7
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: terraform, aws, alb, autoscaling, elb

min_elb_capacity on aws_autoscaling_group only counts instance health via the classic ELB API, so with aws_alb_target_group attachments terraform destroys the old ASG before new instances register healthy, causing 502/504s during rolling updates. There is no config workaround: sleep hacks via local-exec provisioners are the only stopgap until terraform's capacity check is fixed to query the elbv2 API for ALB target group state. Prefer create_before_destroy patterns with ALB verified via curl load tests before relying on min_elb_capacity.
