Closed fergoid closed 7 months ago
I'm not sure I follow the request, it seems you want to exclude resources by membership to a resource group? If that's the ask, shouldn't just excluding the resource group itself (which is already supported) not solve this?
I am sure when I tried earlier it was flagging the group as retained but the resources for deletion. Let me double check and I will get back to you.
I will close the issue if I got it wrong. 😀
Ah, I think you are right. I follow what you are asking now. Let me check on a couple things.
Unfortunately the tool doesn't support global filters yet, but this should work, I just can't test at the moment. ResourceGroup property is set on every resource.
tenants:
77776666-5555-4444-3333-222211110000:
presets:
- common
filters:
SomeRGResourceType:
- property: ResourceGroup
type: contains
value: <rg-name>
I'd be happy to try implementing it if you are okay with that?
Pull Requests are welcome, might require back and forth. Are you asking about implementing Global Filters?
This tool is being completely rewritten to use my new libnuke library. I've got an open issue over there to figure out how to best implement global filters. https://github.com/ekristen/libnuke/issues/25
At the moment resource group exclusions will prevent the group being destroyed but owned resources are still flagged for destruction. Could we add an option to also exclude the resources owned by the group? Something like: Filters: ResourceGroup:
so current the exclusions filter method is unaffected by the change .