Sub topic 1
How AWS charges: pricing dimensions
Prerequisites
This chapter assumes you know:
- The core AWS services EC2, S3, and RDS at a basic level.
- What an AWS Region is.
- How to read a monthly cost breakdown.
You don't need to have used the AWS Pricing Calculator yet. This chapter gives you the vocabulary the calculator relies on.
What a pricing dimension is
A pricing dimension is one measurable quantity that AWS multiplies by a rate to produce a charge. Most services have several dimensions, and each appears as its own line in a bill or an estimate. If you miss a dimension, your estimate comes out too low.
Most dimensions fall into four groups:
| Group | Typical unit | Examples |
|---|---|---|
| Compute time | Instance-hours or seconds, GB-seconds | EC2 instances, RDS instances, Lambda duration |
| Storage | GB-month | S3 objects, EBS volumes, RDS storage, backups |
| Requests and operations | Per request, usually priced per 1,000 or per million | S3 GET and PUT, Lambda invocations, API calls |
| Data transfer | GB moved | Traffic out to the internet, between Regions, between Availability Zones |
How dimensions combine
A single service usually charges on more than one dimension at once.
- EC2 charges for instance runtime, which depends on instance type, operating system, and Region. Attached EBS volumes are billed separately for provisioned GB-month. Depending on the volume type, you may also pay for provisioned IOPS or throughput.
- S3 charges for storage by storage class, for requests by type, and for data transferred out.
- RDS charges for instance hours, provisioned storage, backup storage beyond the free allotment, and data transfer.
- Lambda charges for the number of requests and for duration, measured in GB-seconds (memory size multiplied by run time).
Rates also vary by Region. The same instance type can cost a different amount in two Regions, so the Region you pick is itself a pricing input.
A worked example
Every line item follows the same pattern: quantity multiplied by rate. The sketch below shows that pattern for a small web application. All rates are illustrative placeholders, not current AWS prices.
# Each dimension: (quantity per month, rate per unit). Rates are placeholders.
dimensions = {
"compute (instance-hours)": (730 * 2, 0.02),
"storage (GB-month)": (100, 0.10),
"requests (per 1,000)": (5000, 0.0004),
"data transfer out (GB)": (50, 0.09),
}
total = 0.0
for name, (quantity, rate) in dimensions.items():
cost = quantity * rate
total += cost
print(f"{name:28s} {cost:8.2f}")
print(f"{'total':28s} {total:8.2f}")The instance-hours line uses 730, the average number of hours in a month, for two instances running all month. In the calculator, you supply quantities like these and it applies the current rates for you.
Common errors
- Estimating compute only. Storage, requests, and data transfer are often the lines that surprise people.
- Mixing units. S3 storage is priced per GB-month, requests per 1,000 or per million, and Lambda duration per GB-second. Check the unit on each line before you enter a quantity.
- Ignoring the Region. Rates differ between Regions, and moving data between Regions adds transfer charges.
- Treating "always on" as the default. A resource that runs half the month costs about half as much for time-based dimensions. Storage keeps accruing even when the compute is stopped.
Why this matters for the calculator
The AWS Pricing Calculator is organized around these dimensions. When you configure a service, its input fields map to the dimensions above: instance type and hours for compute, GB for storage, request counts, and transfer volumes. If you can name the dimensions of a service before you open the calculator, you know which numbers to gather from your workload.
Exercise
A workload runs one EC2 instance all month, stores 200 GB in S3, makes 2 million S3 requests, and sends 30 GB out to the internet. List the pricing dimensions you would need to enter, with their units.
Show answer
Compute: instance-hours (about 730 for a full month, plus any attached EBS storage in GB-month). S3 storage: 200 GB-month. S3 requests: 2 million, entered by request type (PUT and GET are priced differently). Data transfer out: 30 GB. The rates for all of these also depend on the Region.