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

Tags filter not working #45

Closed
cloudlena opened this issue Aug 28, 2019 · 4 comments
Closed

Tags filter not working #45

cloudlena opened this issue Aug 28, 2019 · 4 comments

Comments

@cloudlena
Copy link

cloudlena commented Aug 28, 2019

For me, the tags filter is not working... I have multiple resources that have the tag environment: test. However, when I run the following config:

aws_ami:
  - tags:
      environment: test
aws_autoscaling_group:
  - tags:
      environment: test
aws_cloudformation_stack:
  - tags:
      environment: test
aws_ebs_snapshot:
  - tags:
      environment: test
aws_ebs_volume:
  - tags:
      environment: test
aws_efs_file_system:
  - tags:
      environment: test
aws_eip:
  - tags:
      environment: test
aws_elb:
  - tags:
      environment: test
aws_iam_group:
  - tags:
      environment: test
aws_iam_instance_profile:
  - tags:
      environment: test
aws_iam_policy:
  - tags:
      environment: test
aws_iam_role:
  - tags:
      environment: test
aws_iam_user:
  - tags:
      environment: test
aws_instance:
  - tags:
      environment: test
aws_internet_gateway:
  - tags:
      environment: test
aws_key_pair:
  - tags:
      environment: test
aws_kms_alias:
  - tags:
      environment: test
aws_kms_key:
  - tags:
      environment: test
aws_launch_configuration:
  - tags:
      environment: test
aws_nat_gateway:
  - tags:
      environment: test
aws_network_acl:
  - tags:
      environment: test
aws_network_interface:
  - tags:
      environment: test
aws_route53_zone:
  - tags:
      environment: test
aws_route_table:
  - tags:
      environment: test
aws_s3_bucket:
  - tags:
      environment: test
aws_security_group:
  - tags:
      environment: test
aws_subnet:
  - tags:
      environment: test
aws_vpc:
  - tags:
      environment: test
aws_vpc_endpoint:
  - tags:
      environment: test

To me it looks like awsweeper doesn't support filtering by tags for all the AWS resources that officially support tags (e.g. aws_iam_role) in Terraform. Is that possible?

@jckuester
Copy link
Owner

That is correct. Unfortunately, tags are not always returned as part of a List... or Describe... and I need the add some extra logic to fetch tags for every resource (as @kadaan did here for the ELB #47).

Most preferable, I'd like to find some generic way to fetch tags for every resource. I'll need to investigate on that when I find time...

@jckuester
Copy link
Owner

jckuester commented Mar 9, 2020

@mastertinner to be more clear, I added an overview about which resources currently support tags in awsweeper: https://github.com/cloudetc/awsweeper#supported-resources

For aws_iam_role filtering should actually be working.

@jckuester
Copy link
Owner

jckuester commented May 26, 2020

@mastertinner just letting you know that I have now implemented a generic way to make tags working for all resources that support them: https://github.com/cloudetc/awsweeper/releases/tag/v0.9.0.

To see which resources support tags, see the list here (the list has gotten also much longer; over 200 resources are supported now): https://github.com/cloudetc/awsweeper#supported-resources

Let me know if I can close this issue 😃

@cloudlena
Copy link
Author

Thanks a lot for your effort, @jckuester! Looks great and this issue can be closed.

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

No branches or pull requests

2 participants