jckuester / awsweeper

A tool for cleaning your AWS account
Mozilla Public License 2.0
467 stars 45 forks source link

Tag exclusion not functioning for aws_workspaces_directory #122

Open aghassemlouei opened 3 years ago

aghassemlouei commented 3 years ago

When attempting to leverage 0.11.1 the following filter the directory service with the relevant tag does not show up:

aws_workspaces_directory:
  - tags:
      NOT(Owner): bob@bobberson.com

The output indicates that tags may not be parsed properly as other resource types return the tag values underneath each id:

awsweeper --dry-run filter.yml --region us-gov-west-1
   • SHOWING RESOURCES THAT WOULD BE DELETED (DRY RUN)
    ---
    Type: aws_workspaces_directory
    Found: 3
        Id:     d-986735dc38
        Id:     d-9867374fe8
        Id:     d-986736710f
    ---
   • TOTAL NUMBER OF RESOURCES THAT WOULD BE DELETED: 3
jckuester commented 3 years ago

Hi @aghassemlouei,

The output indicates that tags may not be parsed properly as other resource types return the tag values underneath each id:

This looks like this is the case. Can you please run awsls --region us-gov-west-1 -a tags and let me know if your resources with tags are listed correctly? (you find awsls for listing resources here: https://github.com/jckuester/awsls). awsweeper uses awsls as a dependency for listing resources and tags.

Thanks, Jan