Sub topic 8
Activating cost allocation tags
This chapter assumes you can apply tags to AWS resources, use the Billing and Cost Management console, and know that member accounts belong to a management account in AWS Organizations. The CLI steps need the AWS CLI configured with credentials for the management account.
Why tags are not reportable by default
Applying a tag to an EC2 instance, an S3 bucket or an RDS database does not make that tag appear in Cost Explorer. Billing is a separate system from the resource APIs. It only copies a tag key into your cost data after you opt that key in. Opting in is called activating a cost allocation tag.
Activation is a per-key switch. You activate the key Project, and every value of it (checkout, search, and so on) becomes available for grouping and filtering. You don't activate values one at a time.
The two kinds of cost allocation tags
Cost allocation tags come in two types, and each has its own activation list.
| Type | Examples | Who creates them | Notes |
|---|---|---|---|
| User-defined | `Project`, `Environment`, `CostCenter` | You | Any key you apply to a taggable resource |
| AWS-generated | `aws:createdBy` | AWS | Keys start with `aws:`. You can't create or edit them |
AWS-generated tags show up in a separate section of the console and are activated the same way. The aws:createdBy tag records which identity created a resource. It is only applied to some resource types, so it won't cover all your spend.
Who can activate tags
Where you can activate tags depends on your account setup:
- Standalone account: you activate tags in your own account.
- AWS Organizations: only the management account can activate or deactivate cost allocation tags. Member accounts can see the page but can't change it.
- Effect on members: an activation in the management account applies to every member account. If a member account applies the
Projecttag and the management account has activatedProject, the member's spend is reported by that tag.
The IAM identity needs permission for ce:UpdateCostAllocationTagsStatus to change status and ce:ListCostAllocationTags to read it. In the console, the same actions are used behind the Cost allocation tags page.
Step 1: Apply the tags
First, put the tags on resources. This example tags one EC2 instance:
aws ec2 create-tags \
--resources i-0123456789abcdef0 \
--tags Key=Project,Value=checkout Key=Environment,Value=prodTag keys are case sensitive. Project, project and PROJECT are three different keys. If teams use different spellings, you will have to activate each one and your reports will be split. The tagging strategy chapter covers how to prevent this.
Step 2: Wait for the key to appear
A key only appears on the Cost allocation tags page after it has been applied to a resource that generated usage. This can take up to 24 hours. A tag on a stopped instance with no charges, or on a resource that doesn't bill, may never show up.
If a key is missing, check these in order:
- The tag exists on the resource (not only in a template that hasn't been deployed).
- The resource has incurred charges since it was tagged.
- You are looking in the management account, and in the same payer account that receives the bill.
- A day has passed.
Step 3: Activate the keys
You can activate in the console. Open Billing and Cost Management, choose Cost allocation tags, select the keys under User-defined cost allocation tags, and choose Activate.
You can also use the CLI:
aws ce update-cost-allocation-tags-status \
--cost-allocation-tags-status TagKey=Project,Status=Active TagKey=Environment,Status=ActiveThe command returns an Errors list. An empty list means every key in the request was accepted. A key that isn't known to billing yet (see step 2) is reported in Errors with a message, even though the command itself exits successfully. Check the output, not just the exit code.
Large key lists must be sent in batches, since each call accepts only a limited number of entries.
To deactivate a key, send the same command with Status=Inactive. Deactivating stops the key from being added to billing data going forward. It doesn't remove data that was already recorded.
Step 4: Confirm the activation
List the active keys:
aws ce list-cost-allocation-tags --status ActiveEach entry in the output has these fields:
| Field | Meaning |
|---|---|
| `TagKey` | The key, with its exact capitalization |
| `Type` | `UserDefined` or `AWSGenerated` |
| `Status` | `Active` or `Inactive` |
| `LastUpdatedDate` | When the status last changed |
| `LastUsedDate` | The last month in which the key was seen on billed usage |
You can narrow the list with --type UserDefined or --type AWSGenerated, or check one key with --tag-keys Project. A key whose LastUsedDate is old is a candidate for deactivation, because nothing is being billed with it.
Activation itself can take up to 24 hours to reach Cost Explorer. After that, Project and Environment are available when you choose Group by: Tag.
Activation is not retroactive by default
This catches most teams. A tag only appears in billing data for usage that happens after the key is active. If you activate Project on 15 November, the first 14 days of November have no Project values. Cost Explorer shows that spend in the group with an empty tag value.
AWS offers a backfill for this. In the console, use the Backfill tags option on the Cost allocation tags page. From the CLI, call the start-backfill operation:
aws ce start-cost-allocation-tag-backfill \
--backfill-from 2026-06-01T00:00:00ZBackfill reprocesses billing data from the date you give, up to a documented limit (currently 12 months back), and it can be requested only once in a 24-hour period. It applies the tag values that the resources have now, as recorded in billing. It does not guess historic values. If a resource was tagged Project=search only last week, backfill won't attribute earlier usage to a value that wasn't recorded for it. Check the current limits in the AWS documentation before depending on this.
If you can't backfill, either accept the gap or build the earlier months from a different grouping, such as linked account.
Common errors and surprises
- Key never appears. The resource has no billed usage yet, or the tag was applied to a resource type that doesn't support cost allocation.
- Activation fails from a member account. Only the management account can do it. Run the command with management account credentials.
- Report shows an empty tag value group. This is spend with no value for that key. It includes resources never tagged, usage before activation, and services that don't carry tags (some data transfer and support charges).
- Tag changed, but old cost didn't move. Cost is attributed using the tag value at the time of the usage. Retagging a resource changes later cost, not past cost.
- Two spellings of one key.
Environmentandenvironmentsplit the data. Activate the one you standardize on and fix the other at the source. - AWS-generated tag expected on everything.
aws:createdBycovers only certain resource types.
Check your understanding
Exercise
A developer in a member account applied the tag Team=payments to several EC2 instances three days ago. The key does not show up in Cost Explorer's Group by: Tag. List the steps you take, and who must do them.
Show answer
First confirm the key appears on the Cost allocation tags page, which can take up to 24 hours after tagged resources incur usage. Then someone with management account access (a member account can't do it) activates the key Team, in the console or with aws ce update-cost-allocation-tags-status --cost-allocation-tags-status TagKey=Team,Status=Active. Confirm with aws ce list-cost-allocation-tags --status Active. Wait up to another 24 hours for the data to reach Cost Explorer. Spend before activation will have an empty Team value unless you request a backfill.
Exercise
You activated Project on 20 October 2026. In November, a report grouped by Project for October shows a large empty-value group. Give two possible causes and one way to shrink the group for the days before 20 October.
Show answer
Causes: usage before 20 October wasn't tagged in billing data because activation isn't retroactive, and some resources or services have no Project tag at all (for example never tagged, or charges that don't carry tags). To shrink the earlier part, request a cost allocation tag backfill covering the start of October, for example aws ce start-cost-allocation-tag-backfill --backfill-from 2026-10-01T00:00:00Z, within the documented backfill limits.