Interview Prep/AWS/CloudFormation, CloudWatch, KMS, Secrets and Cost

A stack is stuck in `UPDATE_ROLLBACK_FAILED`.

AdvancedTroubleshootingCloudFormation, CloudWatch, KMS, Secrets and Cost
Answer

Likely causes → During rollback, CloudFormation could not return a resource to its old state. Typical reasons: the resource was changed or deleted outside CloudFormation, a dependency is gone, or permissions were removed.

Diagnose →

aws cloudformation describe-stack-events --stack-name app \
  --query "StackEvents[?contains(ResourceStatus,'FAILED')].[Timestamp,LogicalResourceId,ResourceStatusReason]" --max-items 10

Fix →

  1. Fix the underlying issue if you can (re-create the deleted dependency, restore permissions)
  2. Run aws cloudformation continue-update-rollback --stack-name app
  3. If a resource cannot be recovered, skip it: aws cloudformation continue-update-rollback --stack-name app --resources-to-skip MyBrokenResource. Then reconcile that resource manually, because CloudFormation now treats it as matching the old template

Prevent → Never change stack resources by hand. Use stack policies and drift detection, and deploy through change sets.

aws All AWS questions Roadmap: Cloud cost & architecture

More on CloudFormation, CloudWatch, KMS, Secrets and Cost