I have a CloudFormation stack which is made up of 3 nested stacks:
Resources:
ParamsSetup:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: a-params.yaml
ResourcePrep:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: b-prep.yaml
Services:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: c-service.yaml
I realized the ResourcePrep
nested stack was unnecessary, so I moved the only important resource in that stack into the Services
stack and removed the stack from my main template:
Resources:
ParamsSetup:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: a-params.yaml
Services:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: c-service.yaml
Now I have a problem. CloudFormation updates fail because the resource in Services
already belongs to ResourcePrep
, but ResourcePrep
shouldn't exist anymore.
I had expected that CloudFormation would be smart enough to delete the removed stack, but it isn't. The removed stack is still there, and I don't know how to get rid of it. Everything I've read says you should never delete a nested stack manually.
You have a couple options here, none of which are particularly elegant like what your hoping.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.