Stop 15 · Certifications, Portfolio & InterviewsTopics · 8/10

AWS Cost Optimization Scenarios

Part of the AWS Roadmap

In short

"Our cloud bill doubled last month. What do you do?" There's no trick answer. They want a calm, step-by-step investigation instead of "switch everything to spot instances".

Questions like 'our AWS bill doubled, what do you do?' test whether you investigate calmly with Cost Explorer and tags, find the cause and pick fixes like right-sizing, Savings Plans, Spot, storage classes or deleting idle resources.

The blob character holds a very long paper bill while looking up at a steaming water geyser.

Think of it like this

Who left the geyser on?

The electricity bill at home suddenly doubles. You don't sell the fridge in panic. You check the meter, compare with last month, and walk room to room. Ah, the new geyser has been on all day. Fix that first, then think about LED bulbs.

Watch it happen

Investigating a bill that doubled

Confirm
Break down
Find spike
Root cause
Fix
Prevent

1/6Is it real? Check for a one-time charge, a yearly commitment or support fee landing this month.

The big ideas

What you need to know

Tags make costs visible

Tag resources by team, project and environment. Without tags, "who owns this?" takes days to answer.

Data transfer hides

Traffic between zones, regions and out to the internet is billed per GB. It often explains a mystery spike.

Quick wins vs long wins

Deleting waste is fast. Right-sizing, commitments and re-architecture take longer but save more over time.

Catch it early

Budgets and anomaly alerts turn a month-end shock into a message on day two.

See it in code

Walk through the code

bash
1# Unattached EBS volumes: still billed, used by nobody2aws ec2 describe-volumes --filters Name=status,Values=available \3  --query "Volumes[].[VolumeId,Size,CreateTime]" --output table4 5# Elastic IPs not attached to anything (still billed)6aws ec2 describe-addresses \7  --query "Addresses[?AssociationId==null].PublicIp" --output text8 9# NAT gateways: hourly charge plus a per-GB processing charge10aws ec2 describe-nat-gateways \11  --query "NatGateways[].[NatGatewayId,State,VpcId]" --output table

1/3Volumes with status available are attached to no instance. Snapshot if unsure, then delete.

Three classic waste checks. In an interview, naming these shows you've actually looked at a real bill.

Save yourself the pain

Common mistakes

Oops

Jumping to "buy reserved instances" before knowing what caused the spike.

Do this instead

Find the cause first. Commitments discount steady usage; they don't fix a forgotten resource.

Oops

Deleting resources you think are unused without checking owners.

Do this instead

Check tags and ask owners, or snapshot first. Saving money by deleting prod data is a bad story.

Your mission

Practise the investigation

~30 min

Quick check

The bill jumped on the 12th. Line items show NAT gateway data processing went up 10x. A likely cause?

Go deeper

  1. 1Write a step-by-step investigation plan for a sudden bill increase.
  2. 2List five common causes of surprise AWS bills and how to prevent each.
  3. 3Prepare one real story from your labs about a cost you caught or fixed.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge