Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeletionPolicy attribute causes errors #6

Closed
georgeplaton7 opened this issue Feb 19, 2021 · 4 comments
Closed

DeletionPolicy attribute causes errors #6

georgeplaton7 opened this issue Feb 19, 2021 · 4 comments

Comments

@georgeplaton7
Copy link

georgeplaton7 commented Feb 19, 2021

The template does not come up with a DeletionPolicy on the resources to be created. Aws CloudFormation complains that it needs to have a DeletionPolicy mentioned on the resources (see the screenshot below).

error1
I have modified the DeletionPolicy with the value "DeletionPolicy: Delete" yet after I did this change, I got another error "As part of the import operation, you cannot modify or add [Outputs]". See the screenshot below.

error2
Any suggestions ?

@aws-brad
Copy link
Contributor

I'm not able to replicate this, can you please share what settings you used to the deploy the stack and in what region?

@georgeplaton7
Copy link
Author

georgeplaton7 commented Feb 22, 2021

Hi @aws-brad,

I've used the region eu-west-1 (Ireland) with latest master version of this github repo.
Apart from that, I've used a private S3 bucket for the files, in the same region (eu-west-1).

I'm not sure how I can help, do you want me to configure a new demo AWS account where the error can be reproduced?

@georgeplaton7
Copy link
Author

georgeplaton7 commented Feb 22, 2021

@aws-brad also in AWS documentation is mentioned that DeletionPolicy is mandatory to be in the CloudFormation template. See https://aws.amazon.com/blogs/aws/new-import-existing-resources-into-a-cloudformation-stack/

or https://docs.amazonaws.cn/en_us/AWSCloudFormation/latest/UserGuide/resource-import-existing-stack.html

Quote:

In this template I am setting DeletionPolicy to Retain for both resources. In this way, if I remove them from the stack, they will not be deleted. This is a good option for resources which contain data you don’t want to delete by mistake, or that you may want to move to a different stack in the future. It is mandatory for imported resources to have a deletion policy set, so you can safely and easily revert the operation, and be protected from mistakenly deleting resources that were imported by someone else.

@aws-brad
Copy link
Contributor

The tool is not meant to be persistent, rather it's to be used for a point in time assessment. By design, the environment will self terminate after completing the analysis, however the S3 bucket and data will persist until the stack is deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants