Tag it up!

I get it, tagging stuff without a clear benefit is something few folks are willing to do. While AWS introduced Resource Groups and the Tag Editor in 2014, oftentimes tags are not first-class citizens.

While there are good practices for tagging available, it seems that the very act of tagging still is something lots of folks loath. Maybe the benefits are not clear, maybe it's just too cumbersome?

Let's start with a quick review of the mechanics.

To tag the S3 bucket example with owner=me you'd use the following command:

$ aws s3api put-bucket-tagging \
   --bucket example \
   --tagging 'TagSet=[{owner=me}]'

To tag the Lambda function example with owner=me you'd use the following command:

$ aws lambda tag-resource \
   --resource arn:aws:lambda:us-west-1:123456789012:function:example \
   --tags "owner=me"

To tag the ELB example with owner=me you'd use the following command:

$ aws elb add-tags \
   --load-balancer-name example \
   --tags "Key=owner,Value=me"

We see a pattern here and that is consistency. Or, better say, the lack thereof? Now, if you've been using AWS consoles you might not be overly surprised to find that, but fact is that the inconsistencies are also present in the APIs and by extension the SDKs.

One can argue that this is Conway in action, however, I wonder, why do we end-users have to suffer?


Anyways, this was the motivation for me to write awsometag. This simple CLI tool allows you to tag AWS resources, in a uniform manner.

Let's see it in action (using above examples)

$ awsometag arn:aws:s3:us-west-2::example \
   owner=me

$ awsometag arn:aws:lambda:us-west-1:123456789102:function:example \
   owner=me

$ awsometag arn:aws:elasticloadbalancing:eu-west-1:123456789102:loadbalancer/example \
   owner=me

Using the ARN of the AWS resource you want to tag, you can now, thanks to awsometag tag it uniformly :)

Also, we can now use the resource group service to deal with all the resources tagged in the previous step:

AWS resource group

Conclusion: tagging doesn't have to be awkward or complicated. And while we likely won't be able to change (or: fix?) the APIs top-down we can create and/or use tooling such as awsometag to make working with said APIs less painful.