gruntwork-io / cloud-nuke

A tool for cleaning up your cloud accounts by nuking (deleting) all resources within it
https://gruntwork.io/
MIT License
2.75k stars 354 forks source link

Option to not add 'cloud-nuke-first-seen' tag #675

Closed mpahlrothanton closed 4 months ago

mpahlrothanton commented 5 months ago

Hi!

Would it be possible to add a CLI flag to not add the 'cloud-nuke-first-seen' tag on inspected resources?

For example; when I just want to do a cloud-nuke --dry-run or cloud-nuke inspect-aws, I don't necessarily want to change any resources, ie. not add any tags to existing resource.

Otherwise I need to either remove the tags, or add ignore policy to our IaC tooling, eg. Terraform ignore_changes lifecycle policy.

Thanks in advance!

tiagoliveira9 commented 3 months ago

Is this option already available? @hongil0316 Because I still get this tag added with a cloud-nuke --dry-run or cloud-nuke inspect-aws and then breaks my terraform code.

james03160927 commented 3 months ago

Should be available now. Can you try passing in exclude-first-seen flag when running those commands?

tiagoliveira9 commented 3 months ago

@hongil0316 I think your PR was merged after the last release v0.35.0 April 8. If I run cloud-nuke inspect-aws --exclude-first-seen it complains, flag provided but not defined: -exclude-first-seen binary=cloud-nuke version=v0.35.0. If I run cloud-nuke inspect-aws exclude-first-seen, it runs but it adds tags the same. Can you provide instructions to compile locally? Or when trigger a new release?

james03160927 commented 3 months ago

Just released a new version. Do you want to try again? https://github.com/gruntwork-io/cloud-nuke/releases/tag/v0.36.0

tiagoliveira9 commented 3 months ago

@hongil0316 Thanks, I did tried but when the flag is enabled is dies

Searching eip resources in eu-west-1 (1m50s)ERRO[2024-05-23T10:09:37+01:00] runtime error: invalid memory address or nil pointer dereference  binary=cloud-nuke version=v0.36.0