jckuester / awsweeper

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

[0.5.0] Complex tag keys #86

Closed skyzyx closed 4 years ago

skyzyx commented 4 years ago

We have some corporate governance stuff applied over my company's 100+ AWS accounts. We developers use Terraform, the corporate governance resources are created using CloudFormation.

I'm trying to nuke all security groups created by developers, while not touching the ones generated by our overlords.

aws_security_group:
  - tags
      "aws:cloudformation:logical-id": NOT(.*)

tags is supposed to be a map, and since the key has colons in it, I believe I'm supposed to wrap it in quotation marks so the parser doesn't freak out. But when I do this (0.5.0 release), I get the following error message:

failed to unmarshal config: config.yml error=yaml: line 67: mapping values are not allowed in this context

Is there a schema I can look at, are the docs incorrect, or is is because of my weird YAML key? This issue seems a little different from #45, but maybe I'm wrong and they're related?

jckuester commented 4 years ago

Hi @skyzyx, sorry for my late reply.

At a first glance, I spot a missing : after tags, i.e., it should be tags: instead of tags (I double-checked with a YAML valdiator).

Yes, your issue is different to #45, which is about missing tag support for some resources (but I checked, awsweeper supports filtering by tags for aws_security_group resources).

skyzyx commented 4 years ago

Ah YAML, you shall be the death of me. Sorry for the false alarm. Thank you.