cloud-nuke icon indicating copy to clipboard operation
cloud-nuke copied to clipboard

Tag filtering

Open gastrodon opened this issue 4 years ago • 4 comments

I notice that the only resource that can be preserved with tagging are s3 buckets. Would it be acceptable to patch this tool such that every resource may be deleted / preserved based on some tag's presence, for example a tag cloud-nuke-excluded and / or cloud-nuke-included to have exclusive / inclusive deleting?

gastrodon avatar Jan 01 '21 03:01 gastrodon

Yes please! As specified in the docs, the config file format, which can do tag filtering, is a relatively recent addition, and we only added support so far for S3. However, we'd love to have it supported for all resources, so a PR to do that is very welcome!

brikis98 avatar Jan 06 '21 15:01 brikis98

It seems like this issue has been solved by https://github.com/gruntwork-io/cloud-nuke#config-file and the ability to exclude & include a few more resources.

This is not a very actionable issue, so considering closing it. @infraredgirl @marinalimeira thoughts?

ina-stoyanova avatar Sep 27 '21 16:09 ina-stoyanova

The config file doesn't support tag based filtering yet (see https://github.com/gruntwork-io/cloud-nuke#whats-supported), so this issue should still be open.

yorinasub17 avatar Sep 27 '21 16:09 yorinasub17

Just wanted to bring it up, it'd be super helpful to have tag based filtering i.e. cloud-nuke-excluded and cloud-nuke-included so we don't have to mess with or rely on the name of the resource.

lukenny avatar May 11 '22 23:05 lukenny

Hey, same here!

We would love to have this feature added. Being able to destroy all ressources that does not have one specific tag or have cloud-nuke-excluded tag would be such a great feature.

This tool could be the perfect tool to manage developer sandbox at scale.

tommy31 avatar Nov 24 '22 13:11 tommy31

+1 for being able to focus on a tag. This is particularly helpful when you want to target a terragrunt-based service deployment as opposed to all the resources in the region.

brandon-langley-mf avatar Dec 09 '22 21:12 brandon-langley-mf

This feature request has been implemented. Closing this issue.

james03160927 avatar Sep 12 '23 21:09 james03160927

Closing the issue for real ( thanks for implementing! )

gastrodon avatar Sep 20 '23 01:09 gastrodon