Ravindra BagaleCourses & study guides मराठी Track your progress

AWS Cost Optimization and FinOps: Cut Cloud Bills Safely

FinOps is not "never spend". It is knowing who ordered the biryani, whether 40 people ate it, and stopping the buffet when the party ends. AWS bills grow when nobody owns leftovers — idle NAT gateways, forgotten disks, oversized RDS.

What you'll learn in this chapter

  • Why engineers must own cost with product
  • Cost Explorer, Budgets, anomaly detection
  • Rightsizing, SP vs RI, Spot basics
  • Tags, chargeback, idle cleanup
  • Lab, errors, FAQ, interview

1. Everyday example first

Why do we need this?

A Hyderabad edtech bill jumped 3× after a hackathon left 12 gp3 volumes and an idle ALB. No budget alarm. Finance found out at month end. A $20 budget alert would have pinged Slack on day two.

What is it?

FinOps is a culture: engineering, finance and product share cloud cost data. On AWS you use Cost Explorer, Budgets, Cost Anomaly Detection, Compute Optimizer, Savings Plans / RIs, and tagging for chargeback. The Well-Architected Cost Optimization pillar is the checklist.

Monthly FinOps loopTags + BudgetsExplorer who spentRightsizing / delete idleBuy SP only with steady baseline
Never buy a 3-year RI on a weekend experiment.

2. Quick wins (first 30 days)

  1. Turn on Cost Explorer + create a monthly Budget with email/SNS.
  2. Delete idle: unattached EBS, old snapshots, unused EIPs, idle NAT, empty load balancers.
  3. Rightsize EC2/RDS using Compute Optimizer recommendations (staging first).
  4. Require tags: Environment, Team, Application on every create (SCP/policy).
  5. Only then talk Savings Plans for steady production compute.

3. Savings Plans vs Reserved Instances

ToolFlexibilityWhen
Compute Savings PlansAcross instance families/regions (rules apply)Default modern choice for steady compute
EC2 Instance SP / RINarrowerVery stable same-family fleets
SpotCheapest, can reclaimStateless / fault-tolerant workers
CUD-style for othersSageMaker/etc. have own modelsRead service-specific pages

Ravindra Bagale's Tip

A Budget without an owner is decoration. Put a human and a Slack channel on every alarm.

4. Industries

  • SaaS: per-tenant cost tags for gross margin.
  • Banks: showback to business units monthly.
  • Startups: survival — kill staging at night.
  • Data lakes: S3 storage class + lifecycle > bigger clusters.
  • Agencies: separate linked accounts per client.

5. Mini lab: Budget + idle hunt

Do this in ap-south-1 (Mumbai) unless your org forbids it. Set a budget alert first.

How to do it (step by step)

  1. Billing → Budgets → create cost budget $10 with email alert at 80%.
  2. EC2 → Elastic IPs: release unused.
  3. EC2 → Volumes: note unattached; snapshot then delete if lab junk.
  4. Cost Explorer: group by Service last 7 days; screenshot top 3.
  5. Optional: enable Cost Anomaly Detection.

Cleanup (stop billing)

  1. Leave the Budget on — it is cheap insurance.
  2. Document what you deleted in a notes file.

6. Common errors and fixes

Each row is a real mistake students and juniors hit. Read the fix before you panic.

Error / symptomFix
Bill shock, no alertsCreate Budgets same day as account.
Untagged resourcesEnforce required tags via IAM/SCP.
RI / SP purchase too earlyNeed 2–4 weeks of stable baseline.
NAT gateway forgottenOne NAT ~ nontrivial monthly — share or delete labs.
Gp2 leftovers after gp3 moveDelete old volumes/snapshots.
Data transfer surpriseWatch cross-AZ and internet egress.
Explorer emptyWait 24h after enable; check correct account/management view.
Finance-only FinOpsEngineers must see dashboards weekly.
Orphan snapshotsLifecycle policies on AMIs/EBS.
Over-cleaning prodChange windows + peer review before delete.

7. Troubleshooting checklist

  1. Confirm you are in the payer / correct linked account view.
  2. Budgets SNS email in spam? Confirm subscription.
  3. Cost Explorer granularity daily for recent spikes.
  4. Compute Optimizer needs hours of metrics — wait.
  5. Tag Editor to find missing Environment tags.

8. FAQ

Q. Is FinOps only for huge companies?

No — a $50/month student account benefits from a $5 budget.

Q. Savings Plans refundable?

Generally non-refundable commitments — model carefully.

Q. What is showback vs chargeback?

Showback reports; chargeback actually bills teams.

Q. Does S3 Intelligent-Tiering always win?

Often for unknown access; small objects have caveats.

Q. Well-Architected Cost tool?

AWS WA Tool includes Cost pillar questions — use it.

9. Interview Q&A

Q. First three cost actions in a messy account?

Budgets, idle cleanup, tags.

Q. SP vs RI?

SP usually more flexible for compute; RI for specific stable shapes.

Q. How do tags help FinOps?

Allocate spend to Team/App for ownership.

Q. What is rightsizing?

Match instance/DB size to actual utilization.

Q. Who owns cloud cost?

Shared — engineering creates, finance governs, product prioritizes.

Q. Spot risk?

Interruptions — use for tolerant workloads with checkpoints.

10. Tips in English, Marathi and Hindi

Ravindra Bagale's Tip (EN)

Every lab needs a destroy step written before the create step.

Ravindra Bagale's Tip (MR)

प्रत्येक lab ला create आधी destroy step लिहा.

Tip (HI)

हर lab में create से पहले destroy स्टेप लिखो।

Try at home

  1. Create a $5 budget on your sandbox.
  2. List idle resources in a table: type, id, monthly guess.
  3. Propose 5 required tags for your team.

In short

  1. FinOps = shared ownership of cloud spend.
  2. Budgets + tags + idle cleanup before commitments.
  3. Rightsizing beats blind RI shopping.
  4. Write destroy steps into every lab.

Revision, interview and comparison cards

Revise this lesson in a few minutes. Save the cards on your phone or download them as PNG files. The QR code on each card opens this lesson.

Revision card: What is cloud FinOps?. Engineering ships features; finance sees a surprise AWS bill. Nobody owns the gap. FinOps is the practice of teams sharing ownership of cloud spend: visibility, accountability, and optimization. Tag resources → Cost Explorer / CUR → budgets and anomaly alerts → right-size and buy commitments carefully. A weekly review shows idle gp3 volumes; deleting them cuts waste without touching prod traffic.
Revision card: What is cloud FinOps? · Download PNG · Open card page
Revision card: Cost Explorer views. Looking only at the total invoice hides which service or team grew. Cost Explorer groups cost by service, account, region, and tag over a date range. Filter last 30 days; group by Service; then by tag Project for the top service. You see EC2 up 40% on Project=ml-lab after a forgotten g4 instance.
Revision card: Cost Explorer views · Download PNG · Open card page
Revision card: Budgets and anomaly alerts. Finding out about spend on the monthly invoice is too late for a student lab. AWS Budgets warn at thresholds. Cost Anomaly Detection flags unusual spikes automatically. Create a monthly budget with 50/80/100% email alerts; enable anomaly monitor on the account. Crossing 80% emails the owner the same day the lab cluster was left up.
Revision card: Budgets and anomaly alerts · Download PNG · Open card page
Revision card: Right-size before RIs. Buying Reserved Instances for oversized servers locks in waste for a year. First stop idle resources and downsize. Then consider Savings Plans/RIs for steady baseline only. Use Compute Optimizer / CW metrics; resize or schedule off-hours stop for non-prod. A t3.large at 5% CPU becomes t3.small; only then buy a Savings Plan for the steady web tier.
Revision card: Right-size before RIs · Download PNG · Open card page
Revision card: Lab cleanup checklist. NAT gateways, idle ALBs, and unattached EIPs silently bill after class. Same-day cleanup: ASG=0, delete ALB/NAT if unused, release EIP, delete idle EBS/EFS, empty unused ECR. Keep a short checklist in every lab README; verify Cost Explorer next morning. Morning bill shows near-zero for the lab account after checklist.
Revision card: Lab cleanup checklist · Download PNG · Open card page
Comparison: Reserved Instances vs Savings Plans. Reserved Instances: Discount tied more tightly to instance attributes. Savings Plans: Flexible $/hour commitment across families (compute SP).
Comparison: Reserved Instances vs Savings Plans · Download PNG · Open card page
Comparison: Cost Explorer vs AWS Budgets. Cost Explorer: Interactive charts to analyze past/future spend. AWS Budgets: Threshold alerts (cost/usage/RI utilization).
Comparison: Cost Explorer vs AWS Budgets · Download PNG · Open card page
Interview card: What is FinOps in one line?. Shared ownership of cloud spend with data, accountability, and continuous optimization. Not only “cut cost” — also spend wisely where it creates value. Tagged accounts + budgets + monthly review is a beginner FinOps loop.
Interview card: What is FinOps in one line? · Download PNG · Open card page
Interview card: RI/SP before or after cleanup?. After. Commitments on waste lock the waste in. Remove idle, right-size, then buy Savings Plans/RIs for steady baseline. Forgotten g4 lab should be stopped, not reserved.
Interview card: RI/SP before or after cleanup? · Download PNG · Open card page
Interview card: Which tags matter for chargeback?. Environment, Owner/Team, Project/CostCenter — enforced with policy or Organization tag policies. No tags means no fair bill split. Cost Explorer group-by Project shows which course burned GPU hours.
Interview card: Which tags matter for chargeback? · Download PNG · Open card page
Interview card: What is a cloud unit cost?. Spend divided by a business metric (per order, per active user, per GB served). FinOps uses unit cost to see if efficiency improves even when total spend grows. ₹ per checkout fell after cache hit ratio rose, even in a busier month.
Interview card: What is a cloud unit cost? · Download PNG · Open card page

More cards: Ravi Sir's Cards.

Practice Tasks

About this scenario

Ahmednagar Sugar Co-op is a sugar co-operative business in Ahilyanagar. Balasaheb Pawar looks after its IT and cloud work. They count money in INR and run their AWS resources in the ap-south-1 Region. In the tasks below you do real jobs for them using what this lesson teaches. All names, account IDs, IP addresses and numbers are made up for practice.

0 / 16

Easy Get cost and usage

Why: See the bill drivers.

What to do: Get cost and usage with time period 2026-01-01 to 2026-02-01 granularity MONTHLY metrics UnblendedCost.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Easy Describe a budget

Why: Track spend caps.

What to do: Describe budget nagarsugar-monthly for account 131959625285.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Easy Describe instances for waste hunt

Why: Find stopped vs running.

What to do: Describe instances in ap-south-1.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Easy Describe volumes

Why: Orphan EBS costs money.

What to do: Describe volumes in ap-south-1.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Easy List buckets for unused data

Why: Old logs in S3.

What to do: List buckets.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Easy 1-year Reserved Instance term

Why: Commitment length.

What to do: How many years is a common Reserved Instance term taught first?

How:
  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. Click Check answer.

Easy 3-year Savings Plan option

Why: Longer term more discount.

What to do: What is the longer common Savings Plans term in years?

How:
  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. Click Check answer.

Medium Cost by SERVICE

Why: Find expensive services.

What to do: Get cost and usage Start 2026-01-01 End 2026-02-01 MONTHLY UnblendedCost group-by Type DIMENSION Key SERVICE.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Medium Cost by tag Project

Why: Tags power chargeback.

What to do: Get cost and usage Start 2026-01-01 End 2026-02-01 MONTHLY UnblendedCost group-by Type TAG Key Project.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Medium Get cost forecast

Why: Predict month end.

What to do: Get cost forecast Start 2026-10-01 End 2026-11-01 MONTHLY UnblendedCost.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Medium Budget alert at 80 percent

Why: Alert before breach.

What to do: If you alert at 80 percent of budget, what number is that?

How:
  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. Click Check answer.

Medium Allow Cost Explorer read

Why: FinOps role.

What to do: Allow ce:GetCostAndUsage and ce:GetCostForecast on *.

How:
  1. Start with { "Version": "2012-10-17", "Statement": [ ... ] }.
  2. In each statement write Effect, Action and Resource.
  3. Give only what the task needs (least privilege).
  4. Use double quotes and commas correctly. Click Check answer.

Hard Get rightsizing recommendation

Why: Downsize idle EC2.

What to do: Get EC2 rightsizing recommendation.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Hard Savings Plans coverage

Why: Measure commitment use.

What to do: Get Savings Plans coverage Start 2026-01-01 End 2026-02-01 granularity DAILY.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Hard Budget limit JSON

Why: Budget API shape.

What to do: JSON Budget with BudgetName monthly, BudgetLimit Amount 100 Unit USD, TimeUnit MONTHLY, BudgetType COST.

How:
  1. Start from the top-level keys the task names.
  2. Indent child keys with 2 spaces (no tabs).
  3. Fill in each property with the value from the task.
  4. Click Check answer. Key order does not matter.

Hard Required cost tags document

Why: Enforce Project and Env.

What to do: JSON tags required: Project and Env as keys in an array required_tags.

How:
  1. Start from the top-level keys the task names.
  2. Indent child keys with 2 spaces (no tabs).
  3. Fill in each property with the value from the task.
  4. Click Check answer. Key order does not matter.