1
votes

I have a CloudFormation template that launches a nested stack template via a AWS::CloudFormation::Stack resource. I was wondering if there is any way I could disable rollback for the nested stack?

1
By 'sub-stack' you mean a nested stack? - Aditya
@Aditya yes I do - asdf
As per the AWS docs, it doesn't seem possible to be able to specify DisableRollback property for the stack resource. You can set that property on the top-level stack though, if you're okay with allowing the same behavior for both top-level and nested stacks. See: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html - Aditya
@Aditya Just to clarify the use case here is using the launch stack URL. I tried adding the DisableRollback property and didn't seem to affect the template options. We want the user to be able to try launching it again with the same name. At the moment the user would have to go back to the list and delete the failed template. I've also tried adding OnFailure to the properties as well. - vonec

1 Answers

0
votes

You can disable it after the creation by setting it in the console or CLI

It appears that OnFailure and DisableRollback aren't specified in the docs as valid Properties within CF templates but did you try and add the to the template anyway? i.e.

{
  "Type" : "AWS::CloudFormation::Stack",
  "Properties" : {
    "DisableRollback" : true
  }
}

Or YAML

Type: "AWS::CloudFormation::Stack"
   Properties:
     DisableRollback: true

See here for API parameters that are a superset of the documented CF template properties

http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html