Check AWS cost allocation tag coverage correctly
On this page
Use this to confirm whether an AWS cost allocation tag key is active, whether historical cost data can reflect it, and how to read resource-tag values in a CUR 2.0 table created through AWS Data Exports with the tags column selected.
Why this is worth a look
AWS cost allocation tags must be activated in Billing and Cost Management before they appear on billing reports, and activation applies to every value sharing that key. The management account or a standalone account outside an organization controls activation. New keys can take up to 24 hours to appear for activation, followed by up to 24 hours to activate. Management account users can backfill up to 12 months, but a resource must have carried the tag historically. In the older CUR schema, resource tag columns include names such as resourceTags/user:owner. CUR 2.0 provides a tags map whose enabled keys appear only when a value applies to the line item.
Start with this query
SQLRead-only Athena query for a CUR 2.0 table created through AWS Data Exports with the tags column selected. It counts billed line items by whether a chosen resource tag key is present.
WITH tag_presence AS (
SELECT
CASE
WHEN tags['resourceTags/CostCenter'] IS NULL THEN 'missing_or_not_applicable'
ELSE 'present'
END AS tag_status
FROM cur_database.cur_table
)
SELECT
tag_status,
COUNT(*) AS line_item_count
FROM tag_presence
GROUP BY tag_status
ORDER BY line_item_count DESC;How to confirm it
- 01
Confirm who can activate
Open Billing and Cost Management in the management account, or in a standalone account that is not a member of an organization. Organization member accounts do not have access to the cost allocation tags manager.
- 02
Check the tag key status
Go to Cost allocation tags and confirm the key is activated. AWS activates the key, so the status applies to all values that share that key. After a tag is created and applied, allow up to 24 hours for it to appear for activation and up to 24 more hours to activate.
- 03
Review historical coverage
If you need past months, use Backfill tags from the management account. Backfill can cover up to the prior 12 months, but values are available only for periods when the resource had that tag assigned.
- 04
Run the coverage count
Use the query against a CUR 2.0 table created through AWS Data Exports with the tags column selected. Replace the database, table, and example key, then read missing_or_not_applicable as an absence from that line item, not automatic proof of a resource-tagging failure.
Before making changes
Assumptions: you have an Athena-accessible CUR 2.0 table created through AWS Data Exports, its tags column was selected, and the resource tag key is spelled exactly as exported. The query is read-only, counts source rows rather than spend or resources, and uses line items as its unit. It does not establish service-wide inventory coverage. Tag behavior varies by AWS service. Backfill is limited to the previous 12 months, can be requested once every 24 hours, and updates exported data on its refresh cycle. It cannot provide values for periods when the tag was not historically assigned.