How do you enforce tagging policies in your AWS account?

How do you enforce tagging policies in your AWS account?


Related discussions:

Have a script that automatically terminated non-tagged items. People will tag everything then.

This is something I have been trying to figure out too, and I don’t have a good answer yet. I think the first part it tightening down who can spin up new instances and how they can do it – if you give everyone console access and let them go crazy, it will be untenable in short order.

One thing I have thought about is building a front-end that just makes API calls to spin things up, and then it is easy to enforce tagging, if that’s the only way most people have access to it. Unfortunately, that is a little more work than most people have time for. :confused:

This is just what I’m in the process of doing. It’s amazing how quickly people fall into line when you’re blowing away a days hard work because they didn’t tag something :slight_smile:

Not allow people to spin resources up outside of OpsWorks.

Lambda that checks every hour for tag present. Missing it? Shutdown or terminate.

Shotgun? Sythe?

Janitor Monkey.

Are you actually using it? It seems to be the de facto answer but it doesn’t look to be as heavily maintained as it once was.

How many ways to skin a cat, let me count them.

  • AWS Config Rules
  • Tag enforcement w/ AWS Service Catalog (Using parameters)
  • Lambda (my personal favorite)

With lambda, you can trigger on any number of things, such as a schedule, cloudwatch events, an API call to API Gateway, etc.

One of the built-in managed rules with AWS Config Rules is to check for tags.

Config rules are limited to one region as of now

Janitor monkey is ok but requires customization and complete understanding if you need to use it across multiple accounts with different requirements.

My choice is custom scripts for large scale multi-account setups to notify users of untagged resources then proceed with additional actions of turning off, deleting, etc. what ever everyone agrees to.

Lambda scripts work well doing steps above for single accounts or smaller setups. Keep in mind lambda has a 5 minute execution limit and when you have to loop through thousands of resources you may time out.

At the end of the day make sure all the players involved understand the tagging requirements and the actions that will be taken for violations before it is all rolled out. Using dry runs is a good way to test everything.

In addition look into tagging flow down scripts to help automate the tagging. For example copying the tag from the instance to the ebs volumes, ebs volumes to snap shots, AMIs to snapshots, etc.

My .02

We are. We started by simply notifying account owners of untagged instances and then escalated to deleting if not tagged in a certain amount of time after the notice.