Sub topic 3
Seeing your spend with billing and cost-analysis tools
This chapter assumes you know the main cost drivers (compute, storage, data transfer), can run commands in a terminal, and can read JSON. You cannot reduce spend you cannot see, so this chapter covers how to look at your bill and break it down.
The working model
AWS records every billable event as usage, prices it, and writes it into billing data. Several tools read that same data at different levels of detail:
| Tool | Best for | Detail |
|---|---|---|
| Billing console | Reading the monthly invoice | Totals by service |
| Cost Explorer | Interactive and API analysis | Daily or monthly, grouped and filtered |
| Cost and Usage Report (CUR) | Deep analysis in a data warehouse | Line items per resource and hour |
For most day-to-day questions, Cost Explorer is the right place to start. Cost Explorer is the AWS cost-analysis service with a console and an API. Use CUR when you need resource-level detail that Cost Explorer does not give you.
Three ideas to know first
- Granularity is the time bucket:
DAILY,MONTHLY, orHOURLY(hourly must be enabled and covers a short recent window). - Metrics are the numbers you measure.
UnblendedCostis the cost as charged for each usage record.AmortizedCostspreads upfront commitment fees across the period, which makes it more useful once you buy discounts. - Group by splits the total by a dimension such as
SERVICE,LINKED_ACCOUNT,REGION,USAGE_TYPE, or by a cost allocation tag.
Worked example: find the biggest cost drivers
This command returns October 2026 cost grouped by service. The end date is exclusive, so 2026-11-01 covers all of October.
aws ce get-cost-and-usage \
--time-period Start=2026-10-01,End=2026-11-01 \
--granularity MONTHLY \
--metrics UnblendedCost \
--group-by Type=DIMENSION,Key=SERVICEThe response contains a ResultsByTime list. Each entry has Groups, and each group has a service name in Keys and an amount in Metrics.UnblendedCost.Amount. Amounts are returned as strings, so convert them to numbers before sorting.
The workflow is:
- Group by
SERVICEto find the one or two services that dominate the bill. - Filter to that service and group by
USAGE_TYPE. This separates, for example, instance hours from data transfer within one service. - Group by
LINKED_ACCOUNTor by tag to see who owns the spend.
Common errors
- Reading the wrong date range.
Endis exclusive. UsingEnd=2026-10-31silently drops the last day. - Comparing partial months. The current month is incomplete. Compare full months, or the same day range of each.
- Expecting data immediately. Billing data lags by up to about a day, so a cost you just created may not appear yet.
- Grouping by a tag that is not activated. Tags appear in cost data only after you activate them as cost allocation tags, and only for usage after activation. The next chapter covers this.
- Mixing metrics.
UnblendedCostandAmortizedCostdiffer when you hold reservations or savings plans. Pick one and state it when sharing numbers. - Ignoring credits and refunds. These can hide the true run rate. Check whether your view includes them.
Habits that make analysis useful
Look at spend on a regular schedule, not only when the invoice surprises you. Save the views you use often. Note what changed when a number moves, such as a launch, a migration, or a new environment. Later chapters build on this view by adding tags, budgets, and alerts.
Exercise
You run a Cost Explorer query for 2026-10-01 to 2026-10-31 and the total is lower than the invoice for October. What is the most likely cause, and how do you fix it?
Show answer
The End date is exclusive, so October 31 is excluded. Set End=2026-11-01 to cover the whole month.
Exercise
A query grouped by SERVICE shows Amazon EC2 as the largest cost. What is the next grouping you would apply, and why?
Show answer
Filter to EC2 and group by USAGE_TYPE. This separates instance hours, EBS volumes, and data transfer, so you can see which kind of usage drives the cost.