Sub topic 1
How AWS charges: pricing dimensions
Prerequisites
This chapter assumes you have the following:
- Basic familiarity with core AWS services such as EC2, S3, and RDS. You should know what each one does, not how to tune it.
- An understanding of AWS Regions, including that the same service can have a different price in each Region.
- Comfort reading a monthly cost breakdown, such as a line-item bill or a spreadsheet of costs per service.
You do not need to have used the AWS Pricing Calculator yet. This chapter covers the pricing model the calculator is built on. Later chapters cover the tool.
Why pricing dimensions come first
Every calculator input maps to something AWS actually measures. If you don't know what a service measures, you can't tell whether an estimate leaves something out. Most estimate errors are missing dimensions, not wrong prices. A forgotten data transfer line or an unmodeled request charge can change the total more than a few cents of difference in an hourly rate.
A pricing dimension is one measured quantity that a service charges for. Each dimension has a unit (hours, GB-months, requests, GB transferred) and a rate per unit. A service's monthly cost is the sum, across its dimensions, of usage times rate:
service cost = (usage_1 x rate_1) + (usage_2 x rate_2) + ...AWS publishes the dimensions and rates on each service's pricing page. The calculator reads the same price data. It can only multiply the usage you give it, so the quality of the estimate depends on you naming every dimension that matters.
The common dimension families
Most AWS services draw from a small set of dimension families. Learning to recognize them lets you read an unfamiliar pricing page quickly.
| Family | Unit | Typical examples |
|---|---|---|
| Compute time | Instance-hours, or seconds | EC2 instances, RDS instances, Fargate vCPU and memory |
| Capacity held | GB-month, provisioned units | EBS volumes, S3 storage, DynamoDB provisioned throughput |
| Requests and operations | Per 1,000 or per million | S3 GET and PUT, Lambda invocations, SQS requests |
| Work performed | GB-seconds, GB processed | Lambda duration, NAT Gateway data processed |
| Data transfer | GB moved | Internet egress, cross-Region, cross-Availability Zone |
| Features and add-ons | Per hour or per unit | Public IPv4 addresses, Multi-AZ, backups, monitoring |
A single service usually combines several families. The next sections walk through each family.
Compute time
Compute services charge for how long a resource exists in a running state, multiplied by its size. For EC2 On-Demand, the rate depends on instance type, Region, operating system, and tenancy. Linux instances are billed per second with a 60-second minimum, and the published rate is quoted per hour.
Two points trip people up:
- A stopped EC2 instance stops accruing instance charges, but its attached EBS volumes keep accruing storage charges.
- Compute is billed while the resource is provisioned and running, not while it is busy. An idle instance costs the same as a busy one.
Capacity held
Storage is billed on how much you keep, averaged over time. The unit is the GB-month: one GB stored for a month. Storing 100 GB for half a month counts as 50 GB-months. S3, EBS, and RDS storage all work this way, with a different rate per storage class or volume type.
Some services also charge for capacity you reserve rather than use. EBS Provisioned IOPS volumes charge for the IOPS you configure. DynamoDB provisioned mode charges for read and write capacity units you set. You pay for the provisioned level whether or not traffic uses it.
Requests and operations
Many services charge per call. S3 charges per 1,000 requests, and the rate differs by request type, since PUT, COPY, POST, and LIST cost more than GET. Lambda charges per million invocations. A workload that stores little data but makes billions of small requests can have a request cost that exceeds its storage cost.
Work performed
Some services meter the amount of work done instead of time or calls. Lambda duration is measured in GB-seconds: the memory you configure (in GB) multiplied by the execution time (in seconds). A 512 MB function running for 200 ms uses 0.5 x 0.2 = 0.1 GB-seconds per invocation. NAT Gateway charges an hourly fee plus a per-GB fee for data it processes.
Data transfer
Data transfer charges depend on direction and path. As a general pattern:
- Data transferred in from the internet is typically free.
- Data transferred out to the internet is charged per GB, with tiered rates and a small monthly free allowance.
- Data moving between Regions is charged.
- Data moving between Availability Zones in the same Region is charged, usually in each direction.
- Data moving within one Availability Zone over private IP addresses is generally free.
Data transfer is easy to omit because it appears as a separate line, often under a different service name on the bill. A later chapter covers it in detail.
Features and add-ons
The base resource often has optional features priced separately. Examples include RDS Multi-AZ, which roughly doubles the instance charge because a standby instance runs. Another is backup storage beyond the free allowance, and a third is a public IPv4 address, which is billed hourly. These are small per unit and easy to miss, but they appear on the bill every month.
Worked example: one small web stack
Consider a modest application in a single Region: two EC2 instances behind a load balancer, one RDS database, and an S3 bucket for uploads. List each resource and the dimensions it exposes before you open the calculator.
| Resource | Dimensions to capture |
|---|---|
| EC2 (2 instances) | Instance type, hours per month, EBS volume size and type, public IPv4 addresses |
| Application Load Balancer | Hours running, load balancer capacity units (LCUs) consumed |
| RDS database | Instance class, hours, Multi-AZ choice, storage GB, backup storage, IOPS if provisioned |
| S3 bucket | GB stored, PUT and GET request counts, GB served to the internet |
| Data transfer | Internet egress GB, cross-AZ GB between the app and database |
This table is the input checklist for the estimate. Notice that the one "web server" produced about a dozen distinct inputs, and several, such as LCUs, cross-AZ traffic, and request counts, are not obvious from the architecture diagram alone.
Doing the arithmetic by hand
The calculator multiplies usage by rate for you, but you should be able to reproduce any line item. The function below does this for On-Demand compute. A month is taken as 730 hours (8,760 hours in a year divided by 12), the common basis for monthly estimates.
HOURS_PER_MONTH = 730 # average hours in a month, a common basis for monthly estimates
def monthly_compute_cost(hourly_rate, instance_count, utilization=1.0):
"""Estimate monthly On-Demand compute cost.
utilization is the fraction of the month the instances run (0 to 1).
"""
return hourly_rate * HOURS_PER_MONTH * utilization * instance_count
# hourly_rate is an illustrative placeholder, not a current AWS price.
example_rate = 0.02
print(round(monthly_compute_cost(example_rate, instance_count=3, utilization=0.5), 2))With a placeholder rate of 0.02 per hour, three instances running half the month give 0.02 x 730 x 0.5 x 3 = 21.90. The point is the structure: one rate, one time quantity, one count. If your hand result differs from the calculator's line item, the difference usually points to an input you set differently, such as utilization, operating system, or Region.
The same pattern applies to every dimension. Storage is GB x rate per GB-month. Requests are (count / 1,000) x rate per 1,000. Data transfer is GB x rate per GB, applied tier by tier when the rate is tiered.
Dimensions that change the rate, not the usage
Some choices don't add a new line. They change the rate on existing lines. Keep these separate from usage inputs in your notes:
- Region. The same instance type costs different amounts in different Regions. Data transfer between Regions also depends on the pair.
- Instance family and size. A larger size within a family usually scales the rate roughly linearly.
- Operating system and licensing. Windows and some database engines add license charges to the base rate.
- Purchase option. On-Demand, Savings Plans, and Reserved Instances apply different effective rates to the same usage.
- Storage class or volume type. S3 Standard and S3 Glacier classes differ in storage rate, retrieval fees, and minimum duration charges.
Common errors when identifying dimensions
- Pricing only the headline resource. Estimating EC2 instance-hours but leaving out EBS, public IPv4 addresses, and load balancers.
- Ignoring request volume. Treating S3 as a storage-only service when the workload makes many small requests.
- Treating data transfer as zero. Assuming traffic is free because inbound transfer is free, while outbound and cross-AZ transfer are not.
- Mixing units. Entering GB where the calculator expects TB, or per-month where it expects per-day. Check the unit label beside every field.
- Assuming rates are universal. Using a rate from one Region or a blog post for a different Region or an old date. Prices change, and the pricing page is the source of truth.
What this means for the calculator
The calculator presents each service as a form whose fields are its dimensions. Some fields are explicit, such as the number of instances or GB of storage. Others are folded into a single usage question, such as "data transfer out per month". Knowing the dimension families lets you do two things. You can fill in every field with a deliberate value instead of leaving a default. You can also notice when a service you use has charges the form doesn't surface, so you add a separate line for them.
The next chapters build on this. They cover what the calculator is and is not, and how an estimate is organized into services and configurations.
Exercise
A team stores 200 GB in S3 for the full month. Their application makes 5 million GET requests and 500,000 PUT requests that month, and serves 50 GB to the internet. List the pricing dimensions you would enter for the S3 portion of the estimate, and say which one is most likely to be forgotten.
Show answer
Enter four dimensions: storage (200 GB-months in the chosen storage class), PUT requests (500,000, priced per 1,000 at the PUT/COPY/POST/LIST rate), GET requests (5,000,000, priced per 1,000 at the GET rate), and data transfer out to the internet (50 GB, priced per GB after any free allowance). The most commonly forgotten one is data transfer out, because it often shows up separately from the S3 storage and request lines. Request charges are also often skipped when people think of S3 as storage only.
Exercise
Using the monthlycomputecost function with a placeholder rate of 0.10 per hour, what is the monthly cost of 4 instances that run for the whole month? What changes if they run only during a 10-hour workday, 22 days a month?
Show answer
For the whole month, 0.10 x 730 x 1.0 x 4 = 292.00. For the workday schedule, each instance runs 10 x 22 = 220 hours, so utilization is 220 / 730, about 0.301. The cost is 0.10 x 220 x 4 = 88.00. The rate and count are unchanged. Only the time quantity changed, which is why utilization is its own input.