- Newest
- Most votes
- Most comments
The issue you're experiencing is related to how health checks are configured in your Elastic Beanstalk environment and how they interact with Auto Scaling.
By default, even when an application crashes or becomes unresponsive, if the EC2 instance itself is still healthy (passing EC2 status checks), Amazon EC2 Auto Scaling won't automatically replace it. This is actually the intended default behavior, which allows for troubleshooting rather than immediately replacing instances.
There are a few key points to check:
-
While you've set the health check type to both EC2 and ELB in your Auto Scaling group, configuring a health check URL alone doesn't change the health check behavior of your environment's Auto Scaling group. You need to explicitly configure the Auto Scaling group to use ELB health checks as a basis for replacing instances.
-
You need to ensure that the health check configuration in your ALB target group is properly set up to detect your application's health status, not just the instance health.
-
The "Degraded" status in your environment indicates that the health check is detecting the issue, but the Auto Scaling group isn't taking action to replace the instance.
To fix this issue, you should:
- Configure your Auto Scaling group to use ELB health checks for instance replacement. This can be done using a configuration file (.ebextensions) in your Elastic Beanstalk environment with settings like:
Resources:
AWSEBAutoScalingGroup:
Type: "AWS::AutoScaling::AutoScalingGroup"
Properties:
HealthCheckType: ELB
HealthCheckGracePeriod: 300
-
Ensure that your ALB health check is properly configured to check the actual health of your application, not just the instance.
-
Verify that the security groups and network configuration allow the health check traffic between the ALB and your instances.
One user with a similar issue resolved it by switching from a Network Load Balancer to an Application Load Balancer and configuring the health check properly for the ALB so that it matched the check for autoscaling.
Sources
Amazon EC2 Auto Scaling health check setting for your Elastic Beanstalk environment - AWS Elastic Beanstalk
ElasticBeanstalk stuck | AWS re:Post
Basic health reporting - AWS Elastic Beanstalk
Adding in .ebextensions fixed the issue
Resources:
AWSEBAutoScalingGroup:
Type: "AWS::AutoScaling::AutoScalingGroup"
Properties:
HealthCheckType: ELB
HealthCheckGracePeriod: 300
Thanks
answered a year ago
Elastic Beanstalk only replaces instances when the environment’s Auto Scaling group health check type is set to ELB and the load balancer it references reports the instance as unhealthy. Since you attached a manually created ALB and target group, Elastic Beanstalk no longer manages those health checks or propagates them back into its environment health logic. The “Degraded” state you see in the console confirms that the EB health monitor sees the app failing but cannot trigger scaling actions because the ASG isn’t linked to an EB‑managed target group. —Taz
answered a year ago
