Sub topic 11
Finding untagged spend
This chapter assumes you can use the Cost Explorer console, know how tags work on resources, and have already activated at least one cost allocation tag such as Project. If tag activation is new to you, review the earlier chapters first.
Untagged spend is cost that Cost Explorer cannot attribute to a tag value. Every tag-based report has some. The goal is to measure it, find out why it exists, and shrink it.
Why untagged spend appears
A resource's cost lands in the "no tag" group for one of several reasons. The cause decides the fix, so identify it before you act.
| Cause | What happens | Typical fix |
|---|---|---|
| Resource was never tagged | The resource has no `Project` key at all | Tag the resource, and add enforcement for new ones |
| Tag was added after the cost was incurred | Cost allocation tags are not applied retroactively by default | Accept the gap, or backfill if your account allows it |
| Tag key was not activated | The key exists on resources but is not a cost allocation tag | Activate it from the management account |
| Key spelled differently | `project` and `Project` are separate keys | Standardise on one spelling |
| Cost is not taggable | Data transfer, support charges, taxes, and some marketplace items cannot carry your tags | Handle with Cost Categories or accept it as shared cost |
| Resource type does not support tags | Some services only tag certain resource types | Group by service or account instead |
Measuring the gap in the console
In Cost Explorer, set the time range and granularity first. Use a full past month with monthly granularity to get a stable number.
- Set Group by to Tag and choose your key, for example
Project. - Read the group labelled No tag key: Project (the exact label may vary slightly by console version). That group is your untagged spend.
- Compare it to the total. The ratio is your tagging coverage.
Cost as a percentage of the whole is the number to track over time. A single dollar figure is hard to interpret because total spend changes from month to month.
Watch the metric you chose. Unblended cost shows what was charged on the day of use. If you use Savings Plans or Reserved Instances, amortized cost spreads the upfront fees across the term. The untagged share can differ between metrics, because commitment charges often sit at the account level and carry no tags. Pick one metric and use it consistently when comparing months.
Measuring the gap from the CLI
The same query works from the command line. Group by the tag key and the untagged spend is returned in a group with an empty tag value.
aws ce get-cost-and-usage \
--time-period Start=2026-10-01,End=2026-11-01 \
--granularity MONTHLY \
--metrics UnblendedCost \
--group-by Type=TAG,Key=ProjectEach group key has the form Project$value. Untagged spend appears as Project$ with nothing after the dollar sign. The End date is exclusive, so this covers all of October 2026.
To pull out just the untagged amount and the total, pipe the result through jq. This sketch assumes jq is installed.
aws ce get-cost-and-usage \
--time-period Start=2026-10-01,End=2026-11-01 \
--granularity MONTHLY \
--metrics UnblendedCost \
--group-by Type=TAG,Key=Project \
--output json |
jq -r '
.ResultsByTime[0].Groups
| (map(.Metrics.UnblendedCost.Amount | tonumber) | add) as $total
| (map(select(.Keys[0] == "Project$") | .Metrics.UnblendedCost.Amount | tonumber) | add // 0) as $untagged
| "total=\($total) untagged=\($untagged) share=\($untagged / $total * 100 | floor)%"
'The // 0 handles the case where every resource is tagged and no empty group exists.
Locating where the untagged spend sits
A total tells you how much is untagged. You also need to know where. Narrow the untagged group by adding a second dimension.
In the console, filter to the untagged group, then change Group by to Service, Linked account, or Usage type. In the CLI, a filter and a dimension grouping do the same job. Cost Explorer lets you filter on a tag using MatchOptions set to ABSENT, which selects spend where the key has no value.
Save this as untagged.json:
{
"Tags": {
"Key": "Project",
"MatchOptions": ["ABSENT"]
}
}Then run:
aws ce get-cost-and-usage \
--time-period Start=2026-10-01,End=2026-11-01 \
--granularity MONTHLY \
--metrics UnblendedCost \
--filter file://untagged.json \
--group-by Type=DIMENSION,Key=SERVICEThe output lists which services produce the untagged cost. Repeat with Key=LINKED_ACCOUNT to see which accounts are responsible. A few services or accounts usually account for most of the gap, which lets you focus effort.
From service to resource
Cost Explorer's default view stops at the service and usage type. To reach individual resources you have two options.
- Resource-level data in Cost Explorer. Resource-level data for EC2 can be enabled in the Cost Explorer preferences. It covers a limited recent window and requires opting in, so check the current limits in your console.
- Cost and Usage Reports. These contain a resource ID column and your activated tag columns, so you can list every untagged resource with its cost. This is the better route for long-term audits.
Once you have resource IDs, check what is actually tagged. The Resource Groups Tagging API can list resources that lack a key.
aws resourcegroupstaggingapi get-resources \
--tag-filters Key=Project \
--query 'ResourceTagMappingList[].ResourceARN'This lists resources that have the Project key. The API returns tagged resources, so the untagged ones are those missing from this list when compared with your inventory. Note that it also may omit resources that were never tagged at all, depending on the service, which is why a cost-based report is the more reliable source for untagged spend.
Reducing untagged spend
After you know the causes and locations, work through them in order of cost.
- Tag the largest items first. Sort the filtered report by cost and fix the top ten resources. This often removes most of the gap.
- Tag at creation. Add tags in infrastructure-as-code templates, launch templates, and Auto Scaling groups so new resources arrive tagged. Auto Scaling groups can propagate tags to the instances they launch.
- Enforce. Use tag policies to standardise keys and values, and service control policies or IAM conditions that require a tag on creation for supported actions. The governance chapter covers this.
- Cover shared and untaggable cost. Define a Cost Category rule that places spend by account or service into a named group, so it is attributed even without a tag.
- Track the percentage monthly. Set a target, such as 95 percent tagged, and review it with the owners of the largest remaining items.
Tag by the resource owner's real workflow. A rule that engineers must remember to follow tends to decay, while one built into templates holds.
Common mistakes
- Reading an empty tag group as zero. If a key was activated recently, earlier months look entirely untagged. Compare only periods after activation.
- Mixing metrics. Comparing unblended cost one month and amortized the next changes the untagged share for reasons unrelated to tagging.
- Case and spelling variants.
Project,project, andProjekteach form a separate group. Review all keys in the tag list. - Forgetting the management account. Activation is done from the management account in an organization. Member accounts cannot activate keys.
- Chasing 100 percent. Some charges cannot be tagged. Aim for a high, stable percentage and handle the rest with allocation rules.
Exercise
A report for October grouped by the Project tag shows 40 percent of spend in the empty group. You activated Project on 20 October. What should you check before concluding that 40 percent of your resources are untagged, and which CLI filter isolates the untagged spend?
Show answer
Check the activation date. Activation applies only to usage from that point onward, so most of October falls before it and appears untagged regardless of the resource's tags. Compare a full month after activation instead. To isolate the untagged spend, use a filter with a Tags block for key Project and MatchOptions set to ["ABSENT"], passed with --filter file://untagged.json, then group by SERVICE or LINKED_ACCOUNT to see where it sits.
Exercise
Name two causes of untagged spend that tagging more resources cannot fix, and one tool that still lets you attribute that spend.
Show answer
Examples include data transfer, support charges, and taxes, which cannot carry user-defined tags, and tag keys that were not activated, which is fixed by activation rather than tagging. A Cost Category rule can group such spend by account, service, or charge type so it is attributed to a named group.