Sub topic 3
Designing a tagging strategy
Assume you know AWS accounts, common AWS services, and basic Cost Explorer navigation. This chapter focuses on turning tags into reliable cost data.
Design tags for ownership
Choose a small, stable set of keys before creating resources. Common keys include:
Application: the product or system.Team: the responsible group.Environment:dev,staging, orprod.CostCenter: the accounting owner.DataClass: the data sensitivity level.
Use the same spelling and value format everywhere. Decide whether a tag is required, who owns it, and how often it is checked. Do not encode rapidly changing details, such as an instance ID, in a tag.
Find untagged spend
Group a Cost Explorer report by a tag, then inspect the empty tag-value group. This shows spend that has no value for that key. Compare the result with resources that cannot support tags or whose charges are shared, such as data transfer or some AWS-managed services.
A practical improvement cycle is:
- Measure untagged spend by account and service.
- Identify the resource types and teams causing it.
- Add tags through infrastructure templates or provisioning workflows.
- Recheck after billing data updates.
Enforce and audit tags
Use infrastructure-as-code defaults, service control policies where appropriate, tag policies in AWS Organizations, and periodic checks with Tag Editor or Resource Groups Tagging API. Enforcement should distinguish required tags from optional metadata. A failed deployment is preferable to silently misattributed production spend, but shared resources still need an allocation rule.
Run cost queries from the AWS CLI
The Cost Explorer API uses an exclusive end date. This query groups October 2026 cost by Project:
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=ProjectUse AmortizedCost for commitments such as Reserved Instances or Savings Plans when measuring economic ownership. Use UnblendedCost when reconciling invoiced account charges.
Extend tag analysis
| Need | Tool |
|---|---|
| Rule-based groups across tags, accounts, or services | Cost Categories |
| Spending limits and notifications | AWS Budgets |
| Unexpected spending changes | Cost Anomaly Detection |
| Line-item and usage-level analysis | Cost and Usage Report |
Cost Categories can create groups such as “production platform” from several rules, even when resources use different tags. Budgets and anomaly alerts turn reporting into action. A Cost and Usage Report exports detailed billing records to Amazon S3 for analysis with tools such as Athena.
Exercise
A report shows 30 percent of production EC2 spend with an empty Environment value. What should you do first?
Show answer
Identify the untagged resources and their owners, then fix tagging in the provisioning process before relying on the report for allocation.