Sub topic 1
Where AWS cost data comes from
Before you filter a Cost Explorer report or activate a tag, you need to know what the numbers are made of. This chapter follows a charge from a running resource to a row in Cost Explorer. It also explains the dimensions you will group and filter by in later chapters.
Prerequisites
This chapter assumes you have:
- Used the AWS Management Console and know where the Billing and Cost Management pages are.
- A working idea of AWS accounts and AWS Organizations, including member accounts and the management account.
- Awareness of common services such as EC2, S3 and RDS.
- Optionally, the AWS CLI installed and configured. Only the last example uses it.
You also need permission to read cost data. In a member account, an administrator may have to enable access to Cost Explorer for you.
From usage to a charge
AWS meters what you use. An EC2 instance reports running time, an S3 bucket reports stored gigabytes and request counts, and a NAT gateway reports hours and processed bytes. Each meter is a usage type. AWS multiplies the usage quantity by the price for that usage type and records the result as a charge.
Billing data is therefore a long list of line items. Each line item carries attributes that describe it:
- The account that incurred it.
- The service, such as Amazon EC2 or Amazon S3.
- The usage type, such as
BoxUsage:m5.largeorTimedStorage-ByteHrs. - The operation, such as
RunInstancesorPutObject. - The Region.
- The usage quantity and the cost.
- The charge type, such as usage, tax, credit, refund or support fee.
Cost Explorer does not show these line items one by one. It aggregates them. Every group-by option in Cost Explorer is one of these attributes, or a tag (covered in later chapters).
Accounts: the first level of structure
The account is the first boundary in billing data. With a single standalone account, all charges belong to that account. With AWS Organizations, the arrangement changes:
- The management account (also called the payer account) receives the consolidated bill.
- Member accounts (also called linked accounts) incur the usage.
- Cost Explorer in the management account sees every member account's charges. Cost Explorer in a member account sees only that account's charges, unless the management account has changed those settings.
Cost Explorer calls the account attribute Linked account. In the CLI and API it is the LINKED_ACCOUNT dimension. Splitting workloads across accounts is the simplest form of cost attribution, because no tagging is needed. It is also coarse. Many teams share accounts, and one account often hosts several projects. That gap is why tags exist.
Consolidated billing also affects how discounts apply. Reserved Instance and Savings Plans discounts can be shared across member accounts. A charge in one account may be reduced by a commitment bought in another. Chapter 3 covers how the cost metrics treat this.
Services and usage types
Two attributes carry most of the detail you will use.
Service is the product name. In the console it reads naturally, for example "Amazon Simple Storage Service". EC2 is split into several service names. Compute appears as "Amazon Elastic Compute Cloud - Compute". EBS volumes, snapshots and load balancer charges appear under other names, such as "EC2 - Other". That grouping surprises many people, because data transfer and NAT gateway charges land there too.
Usage type is the specific meter. Many usage types begin with a Region prefix, such as USE1- for us-east-1 and EUW1- for eu-west-1. Some examples:
| Usage type | What it measures |
|---|---|
| `USE1-BoxUsage:m5.large` | Hours of m5.large On-Demand instances in us-east-1 |
| `EBS:VolumeUsage.gp3` | Gigabyte-months of gp3 volume storage |
| `USE1-NatGateway-Hours` | Hours that a NAT gateway existed |
| `DataTransfer-Out-Bytes` | Data sent out to the internet |
Usage type is usually what turns a vague "EC2 - Other" figure into an answer. If the total jumped, the usage type tells you whether the cause was volumes, NAT gateways or data transfer.
You can list the values a dimension takes in your own data. This command returns the services that appear in October 2026:
aws ce get-dimension-values \
--time-period Start=2026-10-01,End=2026-11-01 \
--dimension SERVICEThe End date is exclusive. Use the values it returns, exactly as written, when you build filters later.
What Cost Explorer shows, and when
Cost Explorer is a view over this billing data. Four properties of that view cause most of the confusion.
- Delay. Data is refreshed at least once every 24 hours. Today's spend is incomplete and may keep changing. Do not treat a partial day as a real drop in cost.
- Enablement. Cost Explorer must be enabled before you can use it. After you enable it, AWS needs time to prepare your data. Programmatic access through the API depends on the same setting.
- History. By default you can look back about 13 months, and Cost Explorer can forecast forward. Longer history needs extra settings or a different tool, such as Cost and Usage Reports in chapter 16.
- Charge types. The totals can include charges other than plain usage, such as tax, support, credits and refunds. Two reports that look the same can disagree because one includes credits and the other does not. When totals disagree, group by charge type (
RECORD_TYPE) to see why.
A worked query
This command groups October 2026 cost by account and then by usage type, which are two of the attributes described above. It is useful when you want to know which account is spending and on what.
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=LINKED_ACCOUNT Type=DIMENSION,Key=USAGE_TYPEThe response holds one result per month. Each result lists groups whose keys are an account ID followed by a usage type. Each group has an amount and a unit, which is USD for most accounts. A request can have at most two group-by clauses.
Common errors
- Reading a partial day as a trend. Compare complete days only.
- Expecting a resource to appear. Cost Explorer shows aggregates by dimension. It does not list individual resources by default. Per-resource detail needs resource-level data to be turned on or a Cost and Usage Report.
- Using the wrong account's view. If you are in a member account, the totals leave out the rest of the organization.
- Filtering with a guessed service name. Names must match exactly. Fetch them with
get-dimension-valuesfirst. - Forgetting the exclusive end date.
End=2026-10-31leaves out October 31. - Assuming "EC2 - Other" is instances. It usually holds volumes, snapshots, NAT gateways and data transfer.
Exercise
Your Cost Explorer report shows a large "EC2 - Other" amount. Which attribute would you group by next, and why?
Show answer
Group by usage type. "EC2 - Other" combines several kinds of charges, such as EBS volumes, snapshots, NAT gateway hours and data transfer. The usage type shows which meter produced the cost. You could also filter to that service first, so only its usage types appear.
Exercise
You are signed in to a member account in an organization and the totals look too small compared with what finance reports. What is the most likely reason?
Show answer
Cost Explorer in a member account shows only that account's charges. Finance is probably looking at the consolidated bill in the management account, which includes all member accounts.