SimAWSby ShahriarLabs
Search

How the bill is actually calculated · Chapter 1 of 2

How your monthly AWS bill is calculated

AWS charges for resources using four basic vectors — compute time, storage volume, request count, and data transfer — creating bills that accumulate even when servers are idle.

FoundationsBuilds the idea from nothing. No prior AWS assumed.

The four things you pay for

Why does an idle AWS account still generate a bill at the end of the month?

VPC 10.0.0.0/16Private EC210.0.1.50NAT Gateway0.045$/hr + 0.045$/GBS3 BucketPublic EndpointNAT Gateways charge hourly runtime fees plus data processing charges per GB, making direct service endpoints significantly cheaper.

Private subnet instances route external requests to S3 through the NAT Gateway.

1/4
  1. 01

    Compute time is billed by the second

    Virtual servers and functions charge for the time they run. If you launch an EC2 instance and leave it running for 730 hours in a month, you are billed for every second of that time, regardless of whether any users visit your website. Compute is a rental of raw CPU and memory capacity.

  2. 02

    Storage is billed by the gigabyte-month

    Storing files or database backups costs money for as long as those bytes occupy physical disks. AWS charges a monthly rate per gigabyte of allocated storage. This means a 100 GB database disk will cost the same amount whether the database engine is running, stopped, or completely idle.

  3. 03

    Requests and data transfer out

    Services often charge for the volume of actions performed, such as reading an object from S3. Additionally, you are billed for data transfer out of the AWS network to the internet. While sending data into AWS is free, sending data out to users is a major component of overall cloud spend.

Check yourself

You stop a virtual server (EC2 instance) so that it is no longer running. Which resource continues to accumulate charges?

Under the hoodThe same thing from underneath: limits, failure modes, numbers.

The mechanics of pricing pages

How do you calculate the actual cost of a complex cloud resource from its pricing page?

VPC 10.0.0.0/16Private EC210.0.1.50NAT Gateway0.045$/hr + 0.045$/GBS3 BucketPublic EndpointNAT Gateways charge hourly runtime fees plus data processing charges per GB, making direct service endpoints significantly cheaper.

Private subnet instances route external requests to S3 through the NAT Gateway.

1/4
  1. 01

    Decoding dual-charge resources

    Some resources charge along two vectors simultaneously. A NAT Gateway charges a flat hourly rate to exist, plus a per-gigabyte rate for all data passing through it. If you deploy a NAT Gateway across three Availability Zones to ensure reliability, you pay three times the hourly fee even with zero traffic.

  2. 02

    The cost of reserving public IPs

    AWS charges for both in-use and idle public IPv4 addresses, including Elastic IPs. The published base rate is $0.005 per address-hour; attaching an address to a running instance does not generally remove that charge. Eligible credits and addresses you bring to AWS have separate rules. Check current VPC pricing for your deployment.

  3. 03

    Free tier limits and pitfalls

    AWS Free Tier eligibility depends on when the account was opened and its plan. New customers can receive up to $200 in credits. The free plan ends after six months or when credits are exhausted; it does not automatically bill you for exceeding credits. On a paid plan, eligible credits offset charges, and uncovered usage is billed. Credits generally expire after twelve months. Accounts opened before July 15, 2025 follow legacy offers. Check your own plan, credit balance and current service limits.

The numbers

NAT Gateway base rate
$0.045 per hourRunning one NAT Gateway for a full 730-hour month costs $32.85 before any data is transferred.
NAT Gateway data processing charge
$0.045 per GBProcessing 1 TB of data through a NAT Gateway adds $46.08 to the monthly bill.
Idle Elastic IP charge
$0.005 per hourAn unused public IPv4 address left allocated in your account costs $3.65 per month.
EBS General Purpose SSD storage cost
$0.08 per GB-monthAllocating a 100 GB virtual disk costs $8.00 per month, whether the virtual server is running or stopped.

Check yourself

You allocate three Elastic IP addresses but do not attach them to any running resources. What is the approximate cost of leaving them idle for a 30-day month?

Official references & further reading

These lessons simplify selected behaviors for learning. Verify current service limits, Region support and production requirements with the official references. Experiments describe their own assumptions.

Report an error or suggest a clearer explanation →