AWS Tags — beyond a naming convention

Girish V P
Tensult Blogs
Published in
4 min readAug 9, 2018

This Blog has moved from Medium to blogs.tensult.com. All the latest content will be available there. Subscribe to our newsletter to stay updated.

It is good to have a tagging strategy and consistent naming convention for the resources in any organization. Tags allow to identify the resources from many in AWS environment with meaningful name and values. Tags enable you to categorize your AWS resources in different ways, like, purpose, creator, or department. This can also be used by automation scripts to trigger certain action based on the value of a particular tag. But here we will analyze some other uses beyond this. They are,

  • AWS billing reports
  • Resource Groups.

AWS Billing Reports

For small companies which has a few or no departments, the basic billing report setup may be sufficient. But when the company is grown big with multiple departments it is practical to tag each resource with department name. In this experiment each resource is Tagged to name Dept with values Mkt or Prod, so the customer has a good insight on the cost incurred by each department. Billing reports are forwarded to an S3 bucket “air-billing” automatically.

The Configuration

  1. Login to your AWS web console and access your billing console. Click “Preferences” in the left pane. Enable “Receive Billing Reports” and click “sample policy”.

2) After you click “sample policy” from the previous step, a sample policy window opens. Select the policy inside the window and copy(Ctrl+C). Click “Close”. You will paste the policy as a bucket policy for “gir-billing” in the next step.

3) Goto S3 Console select “gir-billing” S3 bucket. In the Permissions tab-> Bucket Policy paste (Ctrl+V) the policy you have copied from the previous step.

4) After Saving the S3 bucket policy, go back to the Preference tab of billing console. Click “Verify”. You should see “Valid Bucket” with a green tick mark. Click “Save preferences”. Now you click “Manage report tags”

5) Select the Tag based on which you want to segregate resources. I have used Dept as the Tag. Click “Activate”.

6) You have to wait for a few days for the bill to get generated. You open the S3 bucket “gir-billing” to see the detailed billing with tags. This is in the form of .zip format. You have to unzip to get a .csv file. Given below is a file with relevant fields.

Resource Groups

AWS Resource Group allows to organize and manage the resources. We see how the tags can be used for searching the AWS resources across the Regions using the Resource Group. As in the previous experiment make sure that there are some resources in various AWS Regions with tag Dept and meaningful value. Here I have used Mkt and Prod.

  1. From AWS web console select “Resource Groups” and click “Create a classic group”.

2) When the windows open, type Group name and select Name/Value pair against Tags field. Click Save

3) Click the “*” mark on the right side of the window ( in the green box) to customize the fields to display. You can the EC2 instances from different AWS Regions. Please, not that you may have to select each type of resource from the left pane of the window like Load Balancers, Security Groups, etc.

Note: You can use the below path alsoto get a similar interface https://resources.console.aws.amazon.com/r/tags

Conclusion

A good tagging strategy is very important in any organization. This allows not only to identify the resources via the AWS console, but also to enhance the billing report and to list resources from various AWS Regions. We are able to identify the cost associated with each department using tags. Also, we are able to search resources in different regions with the help of Resource Group and Tags.

--

--