When I deploy using cloudformation aws cloudformation deploy --region $region --stack-name ABC
Got error:
An error occurred (ValidationError) when calling the CreateChangeSet operation: Stack:arn:aws:cloudformation:stack/service/7e1d8c70-d60f-11e9-9728-0a4501e4ce4c is in ROLLBACK_COMPLETE state and can not be updated.
Please help me !
ValidationError Stack:arn aws cloudformation stack is in ROLLBACK_COMPLETE state and can not be updated. Bookmark this question.
There is a way to force Cloudformation to update the stack using the AWS::CloudFormation::Init . By using cfn-init, each instance can update itself when it detect the change that made by AWS::CloudFormation::Init in metadata.
Your stack might be stuck in DELETE_FAILED status for the following reasons: A stack resource has a dependent object or other dependencies that can't be deleted. To resolve this issue, complete the steps in the Delete a stack with a dependent object or other dependencies that can't be deleted section.
This happens when stack creation fails. By default the stack will remain in place with a status of ROLLBACK_COMPLETE
. This means it's successfully rolled back (deleted) all the resources which the stack had created. The only thing remaining is the empty stack itself. You cannot update this stack; you must manually delete it, after which you can attempt to deploy it again.
If you set "Rollback on failure" to disabled in the console (or set --on-failure
to DO_NOTHING
in the CLI command, if using create-stack
), stack creation failure will instead result in a status of CREATE_FAILED
. Any resources created before the point of failure won't have been rolled back.
If instead you were deploying updates to an existing (successfully created) stack, and the updates failed but were successfully rolled back, it will go back into its previous valid state (with a status of UPDATE_ROLLBACK_COMPLETE
), allowing you to reattempt updates.
As @SteffenOpel points out, you can now specify that a stack should be deleted on failure by setting the --on-failure
option (for create-stack
only, not deploy
) to DELETE
in the CLI. This option is not yet available in the console at the time of writing (13/11/20).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With