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

Filter resources NOT having a tag #101

Merged
merged 11 commits into from
May 11, 2020

Conversation

jckuester
Copy link
Owner

No description provided.

@jckuester jckuester force-pushed the feature-sonderops/untagged-filtering branch from dcfbc0b to ea7e4eb Compare May 10, 2020 17:52
@jckuester jckuester force-pushed the feature-sonderops/untagged-filtering branch from ea7e4eb to 24a0f0d Compare May 10, 2020 17:59
@jckuester jckuester changed the title Untagged filtering (by sonderops) Delete resources not tagged May 11, 2020
@jckuester jckuester changed the title Delete resources not tagged Filter resources NOT having a tag May 11, 2020
@ghost
Copy link

ghost commented May 11, 2020

@jckuester I would be using this feature, let me know if you need some tester :)

@jckuester
Copy link
Owner Author

@andrea-maruccia-leaseplan sure, is it ok for you to build a custom binary of this branch (simply run go build on it) for testing?

@jckuester jckuester force-pushed the feature-sonderops/untagged-filtering branch from 9b62601 to aeb2063 Compare May 11, 2020 09:29
@ghost
Copy link

ghost commented May 11, 2020

@andrea-maruccia-leaseplan sure, is it ok for you to build a custom binary of this branch (simply run go build on it) for testing?

yes no problem, should I test it with the latest commit on this branch?

@jckuester
Copy link
Owner Author

yes. please. I am basically done now.

@ghost
Copy link

ghost commented May 11, 2020

seems to work well!

I used this config for ec2 deletion:

aws_instance:

  • tags:
    NOT(andreatest): .*
    then i tried rds db:

aws_db_instance:

  • tags:
    NOT(andreatest): .*
    but this didn't work. I think it's ok because in your doc you state that it's not supported.

Nice work :)

@jckuester jckuester force-pushed the feature-sonderops/untagged-filtering branch from aeb2063 to be6ede7 Compare May 11, 2020 20:27
@jckuester jckuester merged commit b05f0b0 into master May 11, 2020
@jckuester jckuester deleted the feature-sonderops/untagged-filtering branch May 11, 2020 20:28
@jckuester
Copy link
Owner Author

@andrea-maruccia-leaseplan just letting you know that in the new release aws_db_instance supports tags: https://github.com/cloudetc/awsweeper/releases/tag/v0.9.0. In fact, tag support is repaired for all resources now.

To see which resources support tags, see the list here: https://github.com/cloudetc/awsweeper#supported-resources

@ghost
Copy link

ghost commented May 26, 2020

oh nice @jckuester this is really good news! Is this because you used awsls? what is it exactly?

@jckuester
Copy link
Owner Author

It's an ls command for AWS. You can list AWS resources and attributes via the command line instead of using the console. It's my new open-source project:

% awsls -profile myaccount -region us-west-2  -attribute tags "aws_iam_user"

TYPE           ID       REGION      CREATED               TAGS        
aws_iam_user   foo      us-west-2   2018-11-15 19:53:27               
aws_iam_user   janck    us-west-2   2018-06-30 11:25:34   Name=test 

@ghost
Copy link

ghost commented May 27, 2020

nice thank you

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

Successfully merging this pull request may close these issues.

None yet

2 participants