Tags are labels assigned to your AWS resources, which are used for organizational purposes and to track trends in your data such as cost or usage. You can use these tags to group your data however you want, but sometimes the process can be less than intuitive. Here are seven tricks to using AWS tags properly so that you can confidently and comprehensively dive into managing your resources.
1. Tagging isn’t retroactive.
Tags begin to organize and track data on the day you apply them. If you turn on an instance on January 1st but don’t designate a tag for it until February 1st, then all of that instance’s data for January will remain untagged (or what we at Cloudability call “not set”). This allows AWS to provide an audit trail. You’ll need to plan out your tagging strategy ahead of time if you want historically comprehensive reporting.
2. AWS tags represent a slice in time.
If you build a report of your tracked spending for June 10 to June 15th, your cost reports will show the costs of the resources that were tagged during that time frame. If you change tag values on June 16th, the report for June 10 to June 15th will show the old value.
3. AWS provides two data sources for tags.
The first are Cost Allocation CSV files that are made available in an S3 bucket of your choosing via Programmatic Billing Access. The second source is the AWS Cloudwatch API. Cloudability collects data from both sources and mashes the two together. The former provides exact cost by tag, the latter does not. In our EC2 Usage Analytics feature, Cloudability will calculate estimated cost for EC2 based on Cloudwatch data, but the numbers are based exclusively on On-Demand pricing. This is because Cloudwatch doesn’t indicate what usage was On-Demand, as opposed to Reserved Instance pricing. In our AWS Cost Analytics feature, however, we provide exact cost by tag using the Programmatic Billing Access Cost Allocation files across all taggable AWS products and services.
4. When you add a new tag, you need to tell AWS to include it in your Programmatic Billing Access Cost Allocation file.
AWS doesn’t automatically include any tags in your Cost Allocation File. The Cost Allocation File can be used to split up your cost by tags and aggregates, but you need to add those tags in order for them to be tracked. Furthermore, the Cloudability app can only see your tags if you include them in your Cost Allocation File.
5. Programmatic Billing Access isn’t retroactive.
You can’t build a spending by tag report for June if you turn on Programmatic Billing Access (and Cost Allocation specifically) in July. AWS can only provide Programmatic Billing Access data after the feature is turned on.
6. Use the “Name” tag to get cost by instance.
If you want to build a report of how much each instance costs, then make sure to give each instance a value for the Name tag. Once you’ve done so, you can then easily create a custom report in the Cloudability app using the dimension of “Name” and the metric of “Total Invoiced Cost” to get exact cost by instance. Take it a step further by tagging EBS volumes with instance ID to get EBS cost per instance. Tag the EBS volume with the instance ID. For example:
“instance_id=the_id_of_the_instance_the_volume_is_attached_to”
In order to roll up the box usage and EBS costs into a single line item, you just need to apply that exact same tag to the instances themselves:
“instance_id=the_id_of_the_instance_the_volume_is_attached_to”
Then use Cloudability to report on the tag “instance_id” and you’ll get total cost for compute and storage broken down.
7. You can’t tag everything (but you should tag everything you can).
There are a number of resources that AWS does not allow tagging on. There are some workarounds that allow you to do so anyway, though, like tagging S3 buckets. One of the handiest reports you can build in Cloudability is a list of “untagged” resources (especially EC2 instances) so that you have a working list to go tag. Because not everything is taggable, you should expect to see a sizable amount of “(not set)” items in your Cloudability reports, some of which will likely be instances that don’t support tagging and some of which will be instances that you should go tag.