Updating a stack fails: `Stack:arn:aws:cloudformation:...:stack/app/... is in ROLLBACK_COMPLETE state and can not be updated.`
BeginnerTroubleshootingCloudFormation, CloudWatch, KMS, Secrets and Cost
Answer
Likely causes → The first create of the stack failed and rolled back. A stack in ROLLBACK_COMPLETE cannot be updated; it can only be deleted.
Diagnose →
aws cloudformation describe-stack-events --stack-name app \
--query "StackEvents[?ResourceStatus=='CREATE_FAILED'].[LogicalResourceId,ResourceStatusReason]" --output table
Fix →
- Read the first
CREATE_FAILEDreason and fix the template - Run
aws cloudformation delete-stack --stack-name app && aws cloudformation wait stack-delete-complete --stack-name app - Create the stack again
Prevent → Use --disable-rollback (or --on-failure DO_NOTHING) in dev to debug failed creates, and run cfn-lint in CI.
More on CloudFormation, CloudWatch, KMS, Secrets and Cost
A stack is stuck in `UPDATE_ROLLBACK_FAILED`.AdvancedA pipeline fails with `An error occurred (ValidationError) when calling the UpdateStack operation: No updates are to be performed.`Beginner`InsufficientCapabilitiesException: Requires capabilities : [CAPABILITY_NAMED_IAM]`.BeginnerStack deletion ends in `DELETE_FAILED` with `The bucket you tried to delete is not empty` on an S3 bucket resource.IntermediateDrift detection shows `MODIFIED` on a security group and an RDS instance that someone changed in the console. How do you reconcile?AdvancedDeleting or updating a stack fails: `Export network-VpcId cannot be deleted as it is in use by app-stack`.Intermediate