Skip to content

Filter resources NOT having a tag - #101

Merged
jckuester merged 11 commits into
masterfrom
feature-sonderops/untagged-filtering
May 11, 2020
Merged

jckuester merged 11 commits into
masterfrom
feature-sonderops/untagged-filtering

Conversation

@jckuester

Copy link
Copy Markdown
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

ghost commented May 11, 2020

Copy link
Copy Markdown

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

@jckuester

Copy link
Copy Markdown
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

ghost commented May 11, 2020

Copy link
Copy Markdown

@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
Copy Markdown
Owner Author

yes. please. I am basically done now.

@ghost

ghost commented May 11, 2020

Copy link
Copy Markdown

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
Copy Markdown
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

ghost commented May 26, 2020

Copy link
Copy Markdown

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

@jckuester

Copy link
Copy Markdown
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

ghost commented May 27, 2020

Copy link
Copy Markdown

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.

2 participants

⌂ 换网址