Organizing resources in a meaningful way helps IT teams understand cost spending and overall usage patterns of even the most complex workloads, and this organization of resources can be achieved by leveraging a simple concept called tags. This section covers tagging in depth, as well as discussing some essential best practices and strategies to keep in mind when it comes to tagging resources in your own AWS cloud.
So, what are tags? Tags are key-value pairs of metadata that help identify resources in your AWS account. Each tag’s key is a unique identifier and each key can have only one value associated with it. You can create tags and assign them to almost all AWS resources that you create throughout your AWS accounts, including IAM users, roles, EC2 instances, RDS databases, S3 buckets, and so on and so forth. The most important tagging feature that AWS provides specifically for cost management is AWS cost allocation tags.
A cost allocation tag is an AWS feature that helps monitor your resource usage and costs granularly. Once the tags are activated in the AWS Billing console, you can use them to categorize, organize, and track resources as per their usage and expenditure. There are two types of cost allocation tags:
The following are some examples of this:
key = aws:createdBy
value = 1234567890:dummyUser
Or
key = aws:createdBy
value = AKIAUITOFQDN5EXAMPLE:dummyIamRole
key = EnvironmentName
value = Production
Or
key = Department
value = DEV01
Before you learn further about cost allocation tags, quickly review the few simple steps required to enable these tags using the AWS Management Console.
In order to activate the AWS-generated cost allocation tags, you need to do the following:
Figure 4.1: AWS-generated cost allocation tag enablement
The same process can be followed to enable and activate a user-defined cost allocation tag as well:
Note
Once the tags are activated, they are propagated only to newly created AWS resources that were spawned after the tags were enabled.