Beginner · AWS account, IAM and billing · topic 9 of 50 · 30 min
Pricing, billing and cost control
Explanation
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
| Model | How it works | Discount vs On-Demand | Best for |
|---|---|---|---|
| On-Demand | Pay per second or hour, no commitment | None | New, short or unpredictable work |
| Savings Plans | Commit to a fixed spend per hour (US$ per hour) for 1 or 3 years | Up to about 70% | Steady usage that may change instance type |
| Reserved Instances | Commit to a specific instance type in a region for 1 or 3 years | Up to about 70% | Steady databases and servers |
| Spot Instances | Use spare capacity; AWS can take it back with a 2-minute warning | Up 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.
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 UnblendedCostA 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.
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
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)
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.
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".
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
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- IAM: users, groups, roles and least privilegeAWS account, IAM and billing · same module
- Cost control in practiceServerless, monitoring and cost control
- Serverless with AWS LambdaServerless, monitoring and cost control
- EC2: virtual servers in the cloudCompute and storage: EC2 and S3
- Core Google Cloud servicesGoogle Cloud and comparing the clouds
- Google Cloud structure: projects, billing and IAMGoogle Cloud and comparing the clouds
Questions people ask about this
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%.
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.
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.
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.
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
- This is the last topic of “AWS account, IAM and billing”. The module exam comes next.
- Module 2 exam: AWS account, IAM and billing · 13 questions · 20 min, without help. 4 topics of this module still to finish first.
- Then the next module, Compute and storage: EC2 and S3. 50 topics left in the course before the final exam.