DEV Community

Cover image for How EC2 + EBS Actually Bills: A Breakdown for Engineers
Rick Wise
Rick Wise

Posted on

How EC2 + EBS Actually Bills: A Breakdown for Engineers

The "Stopped Instance" Trap

Every AWS engineer has done it. You spin up an EC2 instance for a quick test, run your script, and then "Stop" the instance thinking you've stopped the bleeding.

You haven't.

While the Compute meter has stopped spinning, the Storage meter is still running at full speed. And if you're using high-performance storage or have elastic IPs attached, you might be bleeding cash without realizing it.

In this post, I'm going to break down exactly how an EC2 instance is billed, component by component, so you can stop leaking money on "zombie" resources.

1. The Compute Layer (EC2)

This is the part everyone understands. When the instance is Running, you pay. When it's Stopped or Terminated, you don't.

  • On-Demand: You pay by the second (minimum 60 seconds).
  • Spot: You pay the market price, which fluctuates.
  • Savings Plans/RIs: You commit to usage in exchange for a discount.

The Gotcha: If you use a "Hibernate" stop instead of a regular stop, you are still paying for the RAM state stored on disk (more on that below).

2. The Storage Layer (EBS) - The Silent Killer

This is where 90% of "phantom costs" come from.

When you launch an EC2 instance, it almost always comes with an EBS volume (the root drive). This volume exists independently of the instance.

  • Scenario: You launch an m5.large with a 100GB gp3 volume.
  • Action: You stop the instance.
  • Result: You stop paying for the m5.large ($0.096/hr), but you continue paying for the 100GB gp3 volume ($0.08/GB/month).

If you have 100 "stopped" dev instances sitting around, that's 10TB of storage you're paying for every month. That's ~$800/month for literally nothing.

The "IOPS" Trap

With gp3 and io2 volumes, you can provision extra IOPS and Throughput. These are billed separately from the storage capacity.

  • Storage: $0.08/GB-month
  • IOPS: $0.005/provisioned IOPS-month (above 3,000)
  • Throughput: $0.04/provisioned MB/s-month (above 125)

If you provision 10,000 IOPS for a database test and then stop the instance, you are still paying for those 10,000 IOPS even though the volume is doing zero reads/writes.

3. The Network Layer (Data Transfer & IPs)

Elastic IPs (EIPs)

This is a classic AWS "tax."

  • Attached to Running Instance: Free (mostly).
  • Attached to Stopped Instance: $0.005/hour.
  • Unattached: $0.005/hour.

If you stop an instance but keep the static IP, AWS charges you because you are "hogging" a scarce IPv4 address.

Data Transfer

  • Inbound: Free.
  • Outbound (Internet): Expensive (~$0.09/GB).
  • Cross-AZ: If your EC2 instance talks to an RDS database in a different Availability Zone, you pay $0.01/GB in each direction.

4. The "Zombie" Snapshot

When you terminate an instance, the root volume usually deletes with it (if "Delete on Termination" is checked). But any manual snapshots you took of that volume remain.

I've seen accounts with terabytes of snapshots from 2018 for instances that haven't existed in 5 years. At $0.05/GB-month, that adds up fast.

The Solution: A "Clean" Shutdown Workflow

Don't just click "Stop." If you're done with an instance for the day (or week), follow this checklist:

  1. Check for EIPs: Release them if you don't need the static IP.
  2. Snapshot & Delete: If you need the data but not the compute, take a snapshot of the volume and delete the volume itself. Snapshots are cheaper ($0.05/GB) than active volumes ($0.08/GB).
  3. Tagging: Tag everything with Owner and ExpiryDate.
  4. Automation: Use a tool (like CloudWise or a simple Lambda) to scan for "Available" volumes (volumes not attached to any instance) and delete them after 7 days.

Summary Checklist

Component Billed When Running? Billed When Stopped? Billed When Terminated?
EC2 Compute ✅ Yes ❌ No ❌ No
EBS Storage ✅ Yes YES ❌ No (if deleted)
EBS IOPS/Throughput ✅ Yes YES ❌ No (if deleted)
Elastic IP ❌ No (usually) YES YES (if not released)
Data Transfer ✅ Yes ❌ No ❌ No

Stop paying for air. Check your "Volumes" tab today.


I'm Rick, building CloudWise to automate this cleanup for you. I write about AWS cost optimization and DevOps every week.

Top comments (0)