Skip to content

Beginner · AWS account, IAM and billing · topic 9 of 50 · 30 min

Pricing, billing and cost control

Explanation

AWS charges mainly for three things: compute time, stored data and data sent out to the internet (data coming in is usually free). You can pay On-Demand, commit for 1 or 3 years with Savings Plans or Reserved Instances for big discounts, or use Spot capacity at up to about 90% off if your work can be interrupted. Budgets, Cost Explorer and tags keep the bill under control.

Why cost is an engineering skill

In a data centre, the hardware is already paid for, so an idle server costs nothing extra. In the cloud, every running resource is a meter that keeps ticking. Cloud engineers are expected to know roughly what their design will cost and to notice when the bill jumps. Some companies call this FinOps: engineers, finance and managers sharing responsibility for cloud spend.

The three main cost drivers

  • Compute: servers, containers and functions, billed by the second, hour or request. An EC2 instance is billed while it is running.
  • Storage: gigabytes stored per month (GB-month), for example in S3 or on EBS disks. A stopped EC2 instance still pays for its disk.
  • Data transfer: data coming IN from the internet is usually free. Data going OUT to the internet is charged per GB, after a free monthly allowance (AWS currently includes 100 GB a month of data out to the internet across most services; check the pricing page). Data between availability zones or regions usually costs a little too.

Many services add other meters: requests (S3 GET and PUT calls), public IPv4 addresses (charged by the hour), NAT gateways (by the hour and by the GB), and snapshots. Always read the pricing page of a service before you use it at scale.

Pricing models for compute

ModelHow it worksDiscount vs On-DemandBest for
On-DemandPay per second or hour, no commitmentNoneNew, short or unpredictable work
Savings PlansCommit to a fixed spend per hour (US$ per hour) for 1 or 3 yearsUp to about 70%Steady usage that may change instance type
Reserved InstancesCommit to a specific instance type in a region for 1 or 3 yearsUp to about 70%Steady databases and servers
Spot InstancesUse spare capacity; AWS can take it back with a 2-minute warningUp to about 90%Batch jobs, CI builds, image processing that can restart

A commitment is charged whether you use it or not. If your server runs only 200 hours a month, an hourly commitment for all 730 hours can cost more than On-Demand. The rule of thumb: commit only to the part of your usage that runs all the time, and leave the spiky part On-Demand.

Tools that keep the bill under control

  • AWS Pricing Calculator: estimate a design before you build it, and share the estimate as a link.
  • Cost Explorer: charts of what you spent, by service, region, account or tag, with a forecast.
  • AWS Budgets: set a monthly amount and get emails (or other alerts) at thresholds such as 80% of actual or 100% of forecast.
  • Cost Anomaly Detection: warns you when spending suddenly behaves unusually.
  • Cost allocation tags: labels such as Project=results-portal or Environment=dev. After you activate them in the Billing console, Cost Explorer can split the bill by them.
  • Free Tier usage alerts and the Free Tier page in the Billing console show how much of your free offers you have used.
bash
aws ec2 create-tags --resources i-0abc1234def567890 \
    --tags Key=Project,Value=results-portal Key=Environment,Value=dev

aws ce get-cost-and-usage \
    --time-period Start=2026-10-01,End=2026-10-19 \
    --granularity MONTHLY --metrics UnblendedCost
Tag a server, then ask Cost Explorer for this month's cost so far.

A worked example

Say a small server costs about US$0.01 an hour, storage costs about US$0.08 per GB-month and data out costs about US$0.09 per GB after 100 free GB. (These are rounded, illustrative rates; check the current pricing page for your region.) Running the server for a full month of 730 hours costs 730 × 0.01 = US$7.30. A 30 GB disk costs 30 × 0.08 = US$2.40. Sending 150 GB to users means 50 chargeable GB, 50 × 0.09 = US$4.50. Total: about US$14.20 a month, before tax.

Tax on Indian bills

Indian customers are billed with GST (Goods and Services Tax) added to their AWS charges. Accounts with an Indian address are usually served by Amazon Web Services India Private Limited (AISPL), which bills in rupees. Check your invoice for the exact tax lines, and give your GSTIN in the tax settings if your company can claim input tax credit.

Careful: Common mistakes: (1) Stopping a server and thinking the bill is zero; its disks, snapshots and public IP addresses still cost money. (2) Leaving test resources running over a weekend. Tag them and delete them. (3) Forgetting that data out to the internet costs money, for example serving large videos without a CDN. (4) Buying a 3-year commitment for a workload that may be switched off in 6 months. (5) Creating the budget after the surprise bill instead of on day one.
Tip: Every Friday, open Cost Explorer for two minutes and group by service. Anything you do not recognise is either a forgotten resource or something to learn about.

Need help?

Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.

Try:

Watch the lesson

Pricing, billing and cost control · 1/7

Cloud cost

In the cloud every running resource is a meter. Knowing what your design costs is part of the job.

Prefer a video by a teacher? Find free videos on “AWS pricing models on-demand savings plans spot billing budgets explained” on YouTube ↗

In real life: An edtech startup cuts its bill by a third

An edtech startup in Noida sees its AWS bill rise from about US$1,800 to US$2,600 a month. Cost Explorer grouped by tag shows that the "dev" environment, used only in office hours, runs 24 hours a day, and that lecture videos are downloaded straight from S3 without a CDN. The team schedules dev servers to stop at night and on weekends, puts CloudFront in front of the videos, buys a 1-year Compute Savings Plan for the two API servers that always run, and moves nightly video transcoding to Spot capacity. The next month's bill is about a third lower, and a budget alert now warns them early.

Practice (0/3 done)

Task 1 · Code · Python

Write monthly_cost(hours, hourly_rate, storage_gb, storage_rate, data_out_gb, data_out_rate, free_out_gb=100). It adds: compute (hours × hourly_rate), storage (storage_gb × storage_rate) and data out (only the GB above free_out_gb, × data_out_rate; never negative). Return the total rounded to 2 decimal places.

Task 2 · Code · Python

One server, one month of 730 hours. On-Demand charges only the hours you use. A Savings Plan commitment charges sp_rate for EVERY hour of the month, used or not. Write compare(hours_used, on_demand_rate, sp_rate) that returns {"on_demand": ..., "savings_plan": ..., "better": "on-demand" or "savings plan"}, with both costs rounded to 2 decimals. If they are equal, say "on-demand".

Task 3 · Practice

In the AWS console (or on paper if you have no account), set up cost control for a learning account: a monthly cost budget with alerts, a cost allocation tag, and a quick look at Cost Explorer. Write down each step and what you chose.

Quick quiz

Question 1

1.Which data transfer is usually FREE on AWS?

Question 2

2.A nightly video-processing job can restart if stopped. Which pricing model is likely cheapest?

Question 3

3.How much warning does AWS give before taking back a Spot Instance?

Question 4

4.Which tool emails you when your spend crosses an amount you set?

Question 5

5.You stopped an EC2 instance. What can still cost money?

Read more (free)

Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.

Which data transfer is usually FREE on AWS?

Answer: Data coming in from the internet

Inbound data transfer from the internet is generally not charged.

A nightly video-processing job can restart if stopped. Which pricing model is likely cheapest?

Answer: Spot Instances

Spot is up to about 90% off and suits work that can handle a 2-minute interruption.

How much warning does AWS give before taking back a Spot Instance?

Answer: 2 minutes

A Spot interruption notice is given 2 minutes before the instance is reclaimed.

Which tool emails you when your spend crosses an amount you set?

Answer: AWS Budgets

Budgets sends alerts at thresholds of actual or forecasted cost.

You stopped an EC2 instance. What can still cost money?

Answer: Its attached disk storage

Stopped instances do not pay for compute, but their EBS volumes are still billed.

A dev server runs only 10 hours a day, 5 days a week instead of 24 × 7. Roughly how much compute cost is saved?Related

Answer: About 70%

168 hours minus 50 hours is 118 hours saved, and 118 / 168 is about 70%.

From Cost control in practice

A function uses 1,024 MB and runs for 500 ms. How many GB-seconds is one run?Related

Answer: 0.5

1,024 MB is 1 GB, and 500 ms is 0.5 seconds. 1 × 0.5 = 0.5 GB-seconds.

From Serverless with AWS Lambda

You stop (not terminate) an EBS-backed instance. What happens?Related

Answer: The root volume is kept and you still pay for it

Stopping ends the compute charge but the EBS volumes remain, and storage is still billed.

From EC2: virtual servers in the cloud

With BigQuery on-demand pricing, what are queries charged by?Related

Answer: The bytes of data scanned

On-demand compute is charged per TiB scanned, with a monthly free amount. Storage is billed separately.

From Core Google Cloud services

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.

Next steps

  1. This is the last topic of “AWS account, IAM and billing”. The module exam comes next.
  2. Module 2 exam: AWS account, IAM and billing · 13 questions · 20 min, without help. 4 topics of this module still to finish first.
  3. Then the next module, Compute and storage: EC2 and S3. 50 topics left in the course before the final exam.

← Previous: IAM policy JSON and how AWS decides