A CloudFormation resource fails with Exceeded attempts to wait
Fix it fast
Most common cause, 1 of 3An ACM certificate is still waiting for domain validation
For a Route 53 zone in this account, add DomainValidationOptions with HostedZoneId and make its DomainName equal the certificate's DomainName; ACM then writes the CNAME itself.
Certificate:
Type: AWS::CertificateManager::Certificate
Properties:
DomainName: example.com
ValidationMethod: DNS
DomainValidationOptions:
- DomainName: example.com
HostedZoneId: Z0123456789EXAMPLEShort answer
Exceeded attempts to wait (HandlerErrorCode NotStabilized) means a CloudFormation resource handler polled until its wait budget ran out before the resource stabilized. Find the resource in describe-stack-events, then remove the blocker: missing ACM DNS validation, a long RDS or Auto Scaling operation needing a service role, or your own CLI waiter giving up. Applies to AWS CLI 2.4x.
Which cause do you have?
List the events that carry a status reason. The resource type next to the first failure tells you which cause applies; if no resource failed and the stack is still in progress, the wait came from your own terminal.
aws cloudformation describe-stack-events --stack-name my-stack --query 'StackEvents[?ResourceStatusReason!=`null`].[Timestamp,LogicalResourceId,ResourceType,ResourceStatus,ResourceStatusReason]' --output tableThen find the line you see in this list and open its fix:
- 1An ACM certificate is still waiting for domain validation
The resource stuck in CREATE_IN_PROGRESS, or failed first, is AWS::CertificateManager::Certificate - 2A slow resource ran past the timeout that applies to your credentials
The failed resource is an Auto Scaling group, an RDS DB cluster or instance, a nested stack, an Elasticsearch domain or a Redshift cluster, and it keeps working in its own console - 3The AWS CLI waiter stopped, while the stack carried on
Your terminal printed Waiter StackCreateComplete failed: Max attempts exceeded, yet the stack status is still CREATE_IN_PROGRESS and no resource has failed
What does the error look like?
Exceeded attempts to waitWaiter StackCreateComplete failed: Max attempts exceeded
Cause 1 of 3
An ACM certificate is still waiting for domain validation
You seeThe resource stuck in CREATE_IN_PROGRESS, or failed first, is AWS::CertificateManager::Certificate
Check
When a certificate's domain is not in a Route 53 zone of the same account, or email validation is chosen, CloudFormation cannot validate it on its own. The stack sits in CREATE_IN_PROGRESS until someone adds the CNAME or answers the email, and AWS lists certificate creation among the operations that can fail to stabilize.
aws cloudformation describe-stack-events --stack-name my-stack --query 'StackEvents[?ResourceType==`AWS::CertificateManager::Certificate`].[ResourceStatus,ResourceStatusReason]' --output tableFix
For a Route 53 zone in this account, add DomainValidationOptions with HostedZoneId and make its DomainName equal the certificate's DomainName; ACM then writes the CNAME itself. For DNS hosted elsewhere, create the CNAME that ACM shows at your DNS provider while the stack is waiting.
Certificate:
Type: AWS::CertificateManager::Certificate
Properties:
DomainName: example.com
ValidationMethod: DNS
DomainValidationOptions:
- DomainName: example.com
HostedZoneId: Z0123456789EXAMPLEVerify
The certificate resource reaches CREATE_COMPLETE and the stack moves on to the resources that depend on it.
aws cloudformation wait stack-create-complete --stack-name my-stackConfirmed by docs.aws.amazon.com
Cause 2 of 3
A slow resource ran past the timeout that applies to your credentials
You seeThe failed resource is an Auto Scaling group, an RDS DB cluster or instance, a nested stack, an Elasticsearch domain or a Redshift cluster, and it keeps working in its own console
Check
AWS lists these types as able to outlast the default stabilization period. The limit depends on the resource and on the credentials used for the stack operation, so an operation run without a service role can stop waiting before the database or group is ready.
aws cloudformation describe-stack-events --stack-name my-stack --max-items 30Fix
Run the stack operation with a service role that CloudFormation assumes; AWS documents this as the way to extend the timeout. If a service role is already in use, AWS Support is the next step.
aws cloudformation deploy \
--template-file template.yaml \
--stack-name my-stack \
--role-arn arn:aws:iam::123456789012:role/cfn-deploy-roleVerify
The slow resource reaches its COMPLETE status in the event list without a NotStabilized reason.
aws cloudformation describe-stack-events --stack-name my-stack --max-items 10Confirmed by docs.aws.amazon.com
Cause 3 of 3
The AWS CLI waiter stopped, while the stack carried on
You seeYour terminal printed Waiter StackCreateComplete failed: Max attempts exceeded, yet the stack status is still CREATE_IN_PROGRESS and no resource has failed
Check
aws cloudformation wait stack-create-complete checks the stack every 30 seconds and exits with code 255 after 120 failed checks. That is a limit of the polling command on your machine, not a failure inside CloudFormation.
aws cloudformation describe-stack-events --stack-name my-stack --max-items 5Fix
Start the wait again, or poll the stack events in your pipeline until a final status appears. Treat exit code 255 as still running unless the events show a failure.
aws cloudformation wait stack-create-complete --stack-name my-stack
echo "exit code: $?"Verify
The wait returns exit code 0 once the stack reaches CREATE_COMPLETE.
aws cloudformation wait stack-create-complete --stack-name my-stack && echo doneConfirmed by awscli.amazonaws.com
How do I stop it coming back?
- Give every ACM certificate in a template a HostedZoneId when its zone lives in the same account, so validation never needs a person.
- Deploy stacks that hold databases or Auto Scaling groups with a dedicated CloudFormation service role instead of a developer's session.
- In CI, follow a stuck deploy with describe-stack-events instead of a fixed CLI waiter, and fail the job only on a FAILED or ROLLBACK status.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine on the same stack: Dispatch Pro, Raheeb, Loade Driver.