I'm working on a CloudFormation template, and an update is failing to apply. I'd like to set the stack option Rollback on Failure to "No" in order to keep the resources around for debugging. How can I disable "rollback on failure" in my CloudFormation template?
Specify the disable-rollback option or on-failure DO_NOTHING enumeration during an execute-change-set operation. Provide a stack name and template to the execute-change-set command with the disable-rollback option. The command returns the following output. Initiate the change set with disable-rollback option.
Because AWS CloudFormation doesn't know the database was deleted, it assumes that the database instance still exists and attempts to roll back to it, causing the update rollback to fail. Depending on the cause of the failure, you can manually fix the error and continue the rollback.
If stack creation fails, go to the CloudFormation Resources list in the AWS Management Console to find the log group. Note that if stack creation fails before any instances are launched, a log group might not be created. By default, AWS deletes CloudWatch log groups if stack creation fails.
You can now pass a DisableRollback
parameter (defaults to false) when running your update stack command. See the docs here:
https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStack.html
I think that option is only available on creation of a stack. The description says Specifies whether the stack should be rolled back if stack creation fails.
.
If you look at the AWS CLI, there is a --disable-rollback
flag available for aws cloudformation create-stack
but no such option exists for aws cloudformation update-stack
.
See here for references also:
Hope that helps.
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