Skip to content
Latchkey

AWS CDK "stack is in ROLLBACK_COMPLETE state and can not be updated" in CI

A stack whose very first create failed lands in ROLLBACK_COMPLETE. CloudFormation cannot update a stack in that state, so the next deploy is rejected until the empty failed stack is deleted.

What this error means

cdk deploy fails with "Stack [MyAppStack] is in ROLLBACK_COMPLETE state and can not be updated. (Service: AmazonCloudFormation; ...). Please delete the stack and try again."

cdk
❌  MyAppStack failed: ValidationError: Stack [MyAppStack] is in ROLLBACK_COMPLETE state
and can not be updated. (Service: AmazonCloudFormation; Status Code: 400; Error Code:
ValidationError; ...)

Common causes

The initial create failed and rolled back

ROLLBACK_COMPLETE only happens after a failed first creation. The stack holds no resources but blocks updates by design.

The root failure was not fixed

Deleting and redeploying without fixing the original CREATE_FAILED cause just reproduces the same rollback.

How to fix it

Delete the failed stack, then redeploy

  1. Fix the underlying CREATE_FAILED cause first.
  2. Delete the empty ROLLBACK_COMPLETE stack.
  3. Run the deploy again to create it cleanly.
Terminal
aws cloudformation delete-stack --stack-name MyAppStack
aws cloudformation wait stack-delete-complete --stack-name MyAppStack
cdk deploy MyAppStack

Address the root cause before retrying

Read the original CREATE_FAILED event so the redeploy does not roll back the same way.

Terminal
aws cloudformation describe-stack-events --stack-name MyAppStack \
  --query "StackEvents[?ResourceStatus=='CREATE_FAILED']"

How to prevent it

  • Fix the first CREATE_FAILED cause before re-running the deploy.
  • Validate templates with cdk diff/synth before first create.
  • Automate deletion of ROLLBACK_COMPLETE stacks in the deploy step.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →