ekristen / aws-nuke

Remove all the resources from an AWS account
https://ekristen.github.io/aws-nuke/
MIT License
246 stars 25 forks source link

Global filter not working as expected #395

Closed eaudetcobello closed 1 month ago

eaudetcobello commented 1 month ago

v3.28

Here is the EC2Address's tags: image

When I use the common preset, the resource is excluded as expected. However, when I use the __global__ filter, I expect the behaviour to be identical (resource should be filtered), but the resource is marked for deletion.

__global__:
  - property: tag:Name
    type: glob
    value: ck8scapi*

presets:
  common:
    filters:
      EC2Address:
        - property: tag:Name
          type: glob
          value: "ck8scapi*"

resource-types:
    includes:
      - EC2Instance

accounts:
  0183023xxxx:
    presets:
      - common
jbcorreia commented 1 month ago

I'm having same issue on v3.29.1, only trying the __global__: config now so not sure if this worked in the past or not

Figured it out, __global__:has to be declared under filters: , works if declared that way, not using presets atm but guessing it works in the same way if declared underfilters: just like any resource

eaudetcobello commented 1 month ago

Ok, the documentation should be updated for clarity. Right now it lacks contexts for the code snippets. For example, __global__ example has no indentation and is the only key available in the snippet, so it's impossible to know where it should go.

ekristen commented 1 month ago

I appreciate the feedback, the documentation was written as pseudo code so that it was easier for copy/paste directly into configurations. I can understand how that could be misleading. I've opened #399 to help clarify usage.

@jbcorreia it should 100% work under any valid filter location, this means preset filters or account filters. There is no top level filters section in the configuration.

ekristen commented 2 weeks ago

:tada: This issue has been resolved in version 3.29.2 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: