- Newest
- Most votes
- Most comments
The error you're encountering, "Error waiting for autoscaling group capacity satisfied: timeout while waiting for state to become 'ok'," suggests that your Auto Scaling group is having difficulty reaching its desired capacity within the expected timeframe. This can happen for several reasons:
-
Instance launch failures: There might be issues preventing the EC2 instances from launching successfully. This could be due to problems with the instance configuration, insufficient resources in the specified Availability Zones, or issues with the Amazon Machine Image (AMI) being used.
-
Lifecycle hooks: If you have lifecycle hooks configured with an ABANDON action, they might be preventing instances from fully launching.
-
Capacity issues: There may not be enough capacity in the selected Availability Zones to fulfill your request.
-
IAM permissions: The IAM role associated with your Auto Scaling group might not have sufficient permissions to launch instances or perform necessary actions.
-
EBS volume encryption: If you're using encrypted EBS volumes, ensure that the necessary Key Management Service (KMS) permissions are in place.
To troubleshoot this issue:
-
Check the Auto Scaling group's Activity history in the AWS Management Console. This can provide more detailed information about why instances are failing to launch.
-
Review your CloudFormation template or Terraform configuration to ensure that the Auto Scaling group settings are correct, including the desired capacity, minimum and maximum instance counts, and launch template or configuration.
-
If you're using CloudFormation, you can try specifying the minimum percentage of instances that must be in service during an update. Update the MinActiveInstancesPercent property of the AutoScalingRollingUpdate policy if you expect the Auto Scaling group not to meet capacity during updates.
-
Consider using the SuspendProcesses property to suspend certain Auto Scaling processes during a rolling update, which might help avoid timeouts.
-
Verify that all necessary IAM permissions are in place for the Auto Scaling group to launch and manage instances.
-
Ensure that there are no network misconfigurations preventing instances from communicating with the load balancers or other required services.
If the issue persists after checking these points, you may need to increase the timeout value in your Terraform configuration or investigate further using AWS CloudTrail logs or CloudWatch metrics to identify any underlying issues affecting instance launches.
Sources
Troubleshoot Amazon EC2 Auto Scaling: Load balancer issues - Amazon EC2 Auto Scaling
Resolve the Group did not stabilize error in AWS Auto Scaling | AWS re:Post
Auto Scaling Group stuck in "Updating Capacity" | AWS re:Post
Relevant content
- asked 3 years ago
- AWS OFFICIALUpdated 9 months ago
Need more accurate answer.
│ Warning: Argument is deprecated │ │ with module.local_codedeploy_s3.data.aws_iam_policy_document.bucket, │ on .terraform/modules/local_codedeploy_s3/data.tf line 52, in data "aws_iam_policy_document" "bucket": │ 52: source_json = data.aws_iam_policy_document.bucket_policy.json │ │ Use the attribute "source_policy_documents" instead. │ │ (and 6 more similar warnings elsewhere) ╵ ╷ │ Error: waiting for Auto Scaling Group (amps-epn-dev-01-si) capacity satisfied: timeout while waiting for state to become 'ok' (last state: 'want at least 1 healthy instance(s) in Auto Scaling Group, have 0', timeout: 15m0s) │ │ with module.asg_single_instance_01.aws_autoscaling_group.asg, │ on .terraform/modules/asg_single_instance_01/main.tf line 5, in resource "aws_autoscaling_group" "asg": │ 5: resource "aws_autoscaling_group" "asg" { │ ╵ ╷ │ Error: waiting for Auto Scaling Group (amps-epn-dev-02-si) capacity satisfied: timeout while waiting for state to become 'ok' (last state: 'want at least 1 healthy instance(s) in Auto Scaling Group, have 0', timeout: 15m0s) │ │ with module.asg_single_instance_02.aws_autoscaling_group.asg, │ on .terraform/modules/asg_single_instance_02/main.tf line 5, in resource "aws_autoscaling_group" "asg": │ 5: resource "aws_autoscaling_group" "asg" { │ ╵ ╷ │ Error: waiting for CloudFormation Stack (arn:aws:cloudformation:us-east-1:796973509963:stack/route53-module-SIMPLE-6cd60c6f3466fc68afe910/4f18fa70-2b15-11f0-b895-12f88c7023cb) create: failed
Checking the activity history of the ASG is key, this implies instances were not able to successfully launch, and you need to see the reason why it failed to launch
From ASG activity history
Status - Cancelled Description - Launching a new EC2 instance: i-01a485fec59b598cb. Status Reason: Instance failed to complete user's Lifecycle Action: Lifecycle Action with token 4a2ed5a6-e820-41e3-9409-2f1ce938cb28 was abandoned: Heartbeat Timeout Cause - At 2025-05-07T23:36:39Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1. StartTime - 2025 May 08, 05:06:41 AM +05:30 EndTime - 2025 May 08, 05:14:57 AM +05:30
The error says the lifecycle hook timed out. You need to make sure to send complete-lifecycle-action when the bootstrapping is done (or remove the hook if you don't need it for anything). Check if the hook is being created by another service (like CodeDeploy) based on its name. https://docs.aws.amazon.com/cli/latest/reference/autoscaling/complete-lifecycle-action.html
It could also be a network connectivity issue. The instance needs to be able to send an outbound call to the AutoScaling service with this API