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

--skip or --ignore flag to prevent certain resource types from being deleted #68

Open
JakeBogie opened this issue Nov 7, 2018 · 4 comments
Labels

Comments

@JakeBogie
Copy link

JakeBogie commented Nov 7, 2018

Hey Y'all!

Would love to see some sort of --ignore option built in!

Example: Use an input file of resources that leftovers would ignore when running...

leftovers --no-confirm --ignore ~/ignored_resources.txt

cat ignored_resources.txt

"IAM Service Account: projects/PROJECT/serviceAccounts/[email protected]"
"IAM Service Account: projects/PROJECT/serviceAccounts/[email protected]"

Now I can keep some resources around on each of the cloud providers that I don't want deleted but totally nuke the rest of the environment.

@genevieve genevieve changed the title Totally a feature request...IGNORE function --skip or --ignore flag to prevent certain resource types from being deleted Jul 2, 2019
@tammersaleh
Copy link

I was looking for something similar but was thinking more along the lines of a tag I could put on resources that I didn't want to be removed.

@genevieve
Copy link
Owner

genevieve commented Dec 23, 2019

Hey @jbogie-pivotal & @tammersaleh!

Given the current implementation of leftovers, the easiest/quickest solution would be to allow leftovers --ignore TYPE where TYPE could be anything from the leftovers types list. Would this cover most of your use-cases or would it only be useful if it was on a specific-resource-name basis?

What each IaaS leftovers object bubbles up to the top is a name that has been generated to include pertinent information (for instance, some resources don't have clear names so I append details like tags or network name to help with filtering them.) This means that it would be more difficult to do an "exact match" between resources in a resources.txt and the names in the list.

If y'all have any suggestions, I'm really open to feedback and ideas!

@JakeBogie
Copy link
Author

@genevieve doing it by type still wouldn't get around the the challenge I'm facing. @tammersaleh has a great idea. Is it possible to ignore by tag?

I could absolutely change my process to create custom tags for 'special' resources and then anytime I cleanup IaaS just use the --ignore tag-foo functionality to spare the stuff I want to keep around.

@tammersaleh
Copy link

Yeah, I'm not sure limiting by resource type would be helpful for my use case either.

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

No branches or pull requests

4 participants