Sub topic 8
Activating cost allocation tags
This chapter assumes you know what AWS Organizations is, can apply tags to resources, and can read a basic Cost Explorer report. It covers the step that connects a resource tag to a cost report: activation.
Why tagging a resource is not enough
A tag on an EC2 instance does not appear in Cost Explorer on its own. Billing data only carries a tag key after you activate that key as a cost allocation tag. Until then, the tag exists on the resource but your cost reports cannot group or filter by it.
Activation has these properties:
- It applies to a tag key, not to individual values. Activating
Projectcoverscheckout,search, and every other value. - It is not retroactive. Cost data starts carrying the tag from the time of activation, so spend before that point stays untagged in reports.
- It can take up to 24 hours for a newly activated key to show up in Cost Explorer.
- A key can only be activated after it has appeared on at least one billed resource. New keys can take up to 24 hours to become available for activation.
- In an organization, only the management account can activate tags. Member accounts cannot.
From resource to report
Step 1: Apply the tags
Add the user-defined tags to a resource. This example tags one EC2 instance with Project and Environment.
aws ec2 create-tags \
--resources i-0123456789abcdef0 \
--tags Key=Project,Value=checkout Key=Environment,Value=prodStep 2: Activate the keys
Run this from the management account. In the console, the same action is under Billing and Cost Management, then Cost allocation tags.
aws ce update-cost-allocation-tags-status \
--cost-allocation-tags-status TagKey=Project,Status=Active TagKey=Environment,Status=ActiveStep 3: Confirm the activation
List the keys that are currently active.
aws ce list-cost-allocation-tags --status ActiveIf a key is missing from the output, check these causes first:
- The key has not yet appeared on a billed resource.
- You ran the command from a member account instead of the management account.
- The key's spelling or case differs from what is on the resource.
projectandProjectare separate keys.
User-defined and AWS-generated tags
User-defined tags are the ones you create, like Project. AWS-generated tags, such as aws:createdBy, are added by AWS and have the aws: prefix. You activate both types the same way, but you cannot create or edit a tag key that starts with aws:.
Common errors
| Symptom | Likely cause |
|---|---|
| Key cannot be activated | It has not yet appeared in billing data |
| Activation call is denied | You are not using the management account |
| Key is active but the report is empty | Less than 24 hours since activation, or the resources were not tagged during the period |
| Old months show no tag data | Activation is not retroactive |
Exercise
You tagged your resources with Team=payments on 1 October and activated the Team key on 15 October. You open a monthly report for October grouped by Team. What do you expect to see for spend from 1 to 14 October, and why?
Show answer
That spend appears in the group with an empty tag value (untagged). Activation is not retroactive, so billing data only carries the Team key from the activation date, even though the resources were tagged earlier.