Cloud Pricing and Cost Management
Understand pay-as-you-go, committed-use and spot pricing, estimate a monthly bill, avoid surprise charges like egress, and build FinOps habits.
Welcome back!
Step 1 of 13Learn
The bill nobody watched
A data team spun up a cluster of large instances to run a one-off analysis. The analysis finished in two days. The cluster ran for five more months, because nobody owned turning it off. Total cost: about $40,000 for a job worth a few hundred dollars of compute.
Cloud pricing is wonderfully flexible and dangerously easy to forget. Costs come from many small meters running at once. The main cost drivers:
- Compute: instance hours or seconds, container resources, function invocations and duration.
- Storage: gigabytes stored per month, by storage class, plus snapshots and backups.
- Data transfer: data coming into the cloud (ingress) is usually free; data going out to the internet (egress) is charged per gigabyte, as is traffic between regions and sometimes between zones.
- Requests and operations: API calls, storage reads and writes, database operations.
- Managed services: load balancers, NAT gateways, databases and analytics are each billed by their own measures, and some charge per hour simply for existing.
Pricing varies by provider, region and service, and it changes over time, so the numbers in this lesson are made-up examples to teach the reasoning. Always check the provider's current pricing pages and pricing calculators before committing to a design.
Step 2 of 13Learn
Pricing models: on-demand, committed and spot
For the same compute, providers offer several purchase options.
On-demand (pay as you go). No commitment; pay per second or hour while it runs. The most flexible and the most expensive per hour. Ideal for short-lived, unpredictable or new workloads.
Committed use: reserved instances and savings plans. You commit to a certain amount of usage for one or three years in exchange for discounts, often roughly 30–70% off on-demand prices depending on term and payment option. Ideal for steady baseline workloads that run all the time, such as production databases. The risk: you pay for the commitment whether you use it or not.
Spot (or preemptible) capacity. The provider's spare capacity at deep discounts, often 60–90% off. The catch: the provider can reclaim it with very short notice, typically a couple of minutes or less. Ideal for interruption-tolerant work: batch processing, rendering, data analysis, test environments and stateless workers in an autoscaling group. Never the only home for a database or anything that can't be interrupted.
A common strategy combines all three: commitments cover the always-on baseline, on-demand handles normal fluctuations, and spot runs batch jobs and absorbs some peaks. Serverless and autoscaling add another lever: when there's no load, you pay little or nothing.
Step 3 of 13Practice · Chart
Same instance, different prices
Tap the cheapest option, the one that can be taken away with about two minutes' notice.
Tap the bar that answers the question, then press Check.
Step 4 of 13Practice · Sort into groups
Sort each workload by the most cost-effective pricing model.
Tap an item, then tap its group (or drag it there).
Step 5 of 13Try the calculator
Monthly cost estimator (made-up prices)
A simple model of a small web app. Prices are illustrative only; check your provider's current pricing. A month is about 730 hours.
- Compute
- 219 $
- Storage
- 11.5 $
- Data transfer out
- 90 $
- Estimated monthly total
- 320.5 $
Step 6 of 13Practice · Work it out
Using the made-up prices: 3 instances at $0.10 per hour running 730 hours, 500 GB of storage at $0.023 per GB, and 1,000 GB of egress at $0.09 per GB. What is the monthly total in dollars?
Step 7 of 13Learn
Keeping costs under control: FinOps
FinOps (cloud financial operations) is the practice of making engineering, finance and business teams jointly responsible for cloud spending. Its habits:
- Visibility first. Tag every resource with an owner, project and environment (for example
team=checkout,env=prod) so costs can be broken down and someone is accountable for each line. Untagged resources are where waste hides. - Budgets and alerts. Set budgets per account or project with alerts at, say, 50%, 80% and 100%, and anomaly detection that flags unusual spikes. A cost alert is also a security alarm.
- Turn off what you don't use. Schedule development and test environments to stop outside working hours; running 50 of 168 hours a week instead of all 168 cuts their compute cost by about 70%.
- Rightsize oversized instances and databases based on measured use.
- Clean up unattached disks, old snapshots, idle load balancers, forgotten test clusters and unused IP addresses, which keep billing quietly.
- Use storage lifecycle rules to move old data to cheaper classes.
- Design for cost: cache content in a CDN to reduce egress, keep chatty services in the same zone or region, and choose serverless for spiky workloads.
- Commit wisely once the baseline is stable and well understood.
Cost is an architecture quality like performance and reliability. The best time to think about it is during design, not after the first surprising bill.
Step 8 of 13Diagram
The FinOps loop
Tap a shape with to see more.
- Inform
Tags, budgets and dashboards show who spends what.
- Optimize
Rightsize, schedule, commit, delete waste.
- Operate
Make it routine: alerts, reviews, policies.
Step 9 of 13Practice · Select all that apply
Which actions are likely to reduce a cloud bill without hurting production? Select all that apply.
Select all that apply.
Step 10 of 13Note
Step 11 of 13Diagram
Where data transfer costs money
Tap a shape with to see more.
- Into the cloud
Usually free.
- Between zones
Often a small charge.
- Between regions
Charged per GB.
- Out to the internet
Charged per GB; the classic surprise.
Step 12 of 13Practice · Work it out
A development environment costs $1,200 per month when running 24/7 (about 730 hours). If it runs only during working hours, about 220 hours a month, roughly how many dollars per month does its compute cost drop to? Round to the nearest dollar.
Step 13 of 13Practice · What would you do?
What would you do?
A startup's cloud bill has doubled in three months, and nobody can say which team or project is responsible. What is the most useful first step?
Lesson complete!