How can I get my AWS CloudFormation stack to update if it's stuck in the UPDATE_ROLLBACK_FAILED state?
Last updated: 2019-05-22
My AWS CloudFormation stack is stuck in the UPDATE_ROLLBACK_FAILED state. How can I update my stack?
If your stack is stuck in the UPDATE_ROLLBACK_FAILED state after a failed update, then AWS CloudFormation can't roll back one or more stacks to a previous working state.
To update your stack, use ContinueUpdateRollback to resolve the error without skipping any stack resources. For solutions to common errors that cause update rollback failures, see Update Rollback Failed. If these solutions don't work, complete the following steps to skip the resources that caused the rollback failures using ContinueUpdateRollback.
You can roll the stack back to a working state with either the AWS CloudFormation console or AWS Command Line Interface (AWS CLI).
AWS CloudFormation console:
1. Open the AWS CloudFormation console.
2. From the Stack Name column, select the stack that's stuck in UPDATE_ROLLBACK_FAILED status.
3. Choose Actions, and then choose Continue Update Rollback.
4. (Optional) If you want to skip the resources, choose Advanced Options, and then enter the logical IDs of the resources that you want to skip.
1. In the AWS CLI, run the continue-update-rollback command. See the following example:
$ aws cloudformation continue-update-rollback --stack-name awsstackname123 --resources-to-skip awsfaultyresource123
Note: Replace awsstackname123 with the name of your stack, and replace awsfaultyresource123 with the logical IDs of your resource.
Important: AWS CloudFormation sets the status of specified resources to UPDATE_COMPLETE. Then, it continues to roll back the stack. After the rollback is complete, the state of the skipped resources is inconsistent with the state of the resources in the stack template. Before performing another stack update, update the stack or resources to be consistent with each other. If you don't do this, subsequent stack updates can fail, and the stack becomes unrecoverable.
If you have nested stacks that need to be rolled back to a working state, follow the instructions at Using ResourcesToSkip to recover a nested stacks hierarchy.