Feature Request: protect resources from deletion based on a tag
Example use case:
Let's say you have a sandbox/dev account and want to use cloud-nuke to keep it clean of old artifacts, but on the other hand have resources that you're actively using and that may also be even older than your time threshold.
Solution:
Tag those resources with something like 'cloud-nuke'='protect'
Yea, we'd love to support:
- A whitelist of tags to destroy (only destroy resources with the specified tags)
- A blacklist of tags not to destroy (destroy anything that doesn't have the specified tags)
PRs welcome 😁
FWIW, cloud-nuke does respected the "protected" flag on EC2 Instances already...
I envision us allowing the user to specify tags via a CLI flag instead of defaulting to a single one
Yes, exactly; the whitelist and blacklist of tags I mentioned above would be passed in as CLI args.
@brikis98,
I'd be happy to work on this, as it's something that would be really useful and I have a bit of spare time.
A couple of questions though: Should we have a separate method to nuke included/excluded tagged resources rather than using the existing one? What sorts of tests would you want for this? I know you are running builds using circle CI so wonder what you do about creating/tearing down resources.
Should we have a separate method to nuke included/excluded tagged resources rather than using the existing one?
Not sure I follow what you're referring to by "method." Do you mean a separate top-level CLI command? Or separate Go method?
What sorts of tests would you want for this? I know you are running builds using circle CI so wonder what you do about creating/tearing down resources.
Probably a test that launches a few resources, some with tags, some without, and makes sure cloud-nuke with various tag parameters cleans up the right ones.
I mean a separate go method for nuking tagged resources.
From: Yevgeniy Brikman [email protected] Sent: 12 March 2019 19:04 To: gruntwork-io/cloud-nuke [email protected] Cc: Sean Farrow [email protected]; Comment [email protected] Subject: Re: [gruntwork-io/cloud-nuke] Feature Request: protect resources from deletion based on a tag (#38)
Should we have a separate method to nuke included/excluded tagged resources rather than using the existing one?
Not sure I follow what you're referring to by "method." Do you mean a separate top-level CLI command? Or separate Go method?
What sorts of tests would you want for this? I know you are running builds using circle CI so wonder what you do about creating/tearing down resources.
Probably a test that launches a few resources, some with tags, some without, and makes sure cloud-nuke with various tag parameters cleans up the right ones.
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/gruntwork-io/cloud-nuke/issues/38#issuecomment-472139277, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABY1fq_jndF5UMJblw7i7S4HbVJiphmwks5vV_ohgaJpZM4YcwkL.
I mean a separate go method for nuking tagged resources.
I'd be tempted to say it makes sense to update the existing methods to take tags into account as well, as it should be possible to specify tags and other params (e.g., creation date).
I agree, let me get a PR done in the next few days.
From: Yevgeniy Brikman [email protected] Sent: 12 March 2019 19:14 To: gruntwork-io/cloud-nuke [email protected] Cc: Sean Farrow [email protected]; Comment [email protected] Subject: Re: [gruntwork-io/cloud-nuke] Feature Request: protect resources from deletion based on a tag (#38)
I mean a separate go method for nuking tagged resources.
I'd be tempted to say it makes sense to update the existing methods to take tags into account as well, as it should be possible to specify tags and other params (e.g., creation date).
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/gruntwork-io/cloud-nuke/issues/38#issuecomment-472142789, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABY1fvMdLW0VtGDmwrlaBc5LbCG0kXTwks5vV_yBgaJpZM4YcwkL.
Thank you!
Has there been any progress on this (also in regards to the abovementioned PR)? I'd love to see the tag whitelist.
Nothing has happened currently, I am in the process of a big house move, but will get to this when settled.
From: Tobi Fuhrimann [mailto:[email protected]] Sent: 23 August 2019 14:58 To: gruntwork-io/cloud-nuke [email protected] Cc: Sean Farrow [email protected]; Comment [email protected] Subject: Re: [gruntwork-io/cloud-nuke] Feature Request: protect resources from deletion based on a tag (#38)
Has there been any progress on this? I'd love to see the tag whitelist.
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/gruntwork-io/cloud-nuke/issues/38?email_source=notifications&email_token=AALDK7RXDN3NTJUX3XNZHMLQF7UHPA5CNFSM4GDTBEF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5AJHFA#issuecomment-524325780, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AALDK7UT2L23EMAXIOCIHL3QF7UHPANCNFSM4GDTBEFQ.
Has there been any update to this enhancement request?
Not as yet, but there will be after Christmas. I now have some time and need it for a project. Thanks, Sean.
From: Rodney Marable [mailto:[email protected]] Sent: 15 December 2019 03:34 To: gruntwork-io/cloud-nuke [email protected] Cc: Sean Farrow [email protected]; Comment [email protected] Subject: Re: [gruntwork-io/cloud-nuke] Feature Request: protect resources from deletion based on a tag (#38)
Has there been any update to this enhancement request?
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/gruntwork-io/cloud-nuke/issues/38?email_source=notifications&email_token=AALDK7RDYSHLS6VLUF57PBLQYWQTVA5CNFSM4GDTBEF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG4QPKA#issuecomment-565774248, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AALDK7XGYZCEBVFIH5RZDWLQYWQTVANCNFSM4GDTBEFQ.
I started a PR which would allow inclusion and exclusion by a tag.
Contributions and feedback welcome: #109
Similar issue https://github.com/gruntwork-io/cloud-nuke/issues/166. WIll close this one and continue the conversation in this issue - https://github.com/gruntwork-io/cloud-nuke/issues/166