Sub topic 1
How AWS charges for data transfer
AWS prices data transfer by direction and by path. The same gigabyte can be free, cost a cent, or cost nine cents, depending on where it starts and where it ends. This chapter gives you the model that the rest of the tutorial builds on.
Prerequisites
This chapter assumes you know the following:
- Regions, Availability Zones (AZs), VPCs, and subnets.
- How to use EC2 and S3 from the console or CLI.
- Basic IP addressing and routing, including the difference between private and public addresses.
The core rule: direction matters
AWS bills data transfer mainly on traffic that leaves a resource. Three rules cover most cases:
- Data transfer in from the internet is free.
- Data transfer out to the internet is charged per GB, with a small monthly free allowance and lower rates at higher volumes.
- Traffic between AWS locations is charged according to how far it travels.
The figures below are approximate us-east-1 list prices. Rates vary by region and change over time, so confirm them on the AWS pricing pages before you plan around them.
| Traffic path | Typical charge |
|---|---|
| Internet into AWS | Free |
| Within one AZ, using private IPs | Free |
| Between AZs in one region | About $0.01/GB in each direction |
| Between regions | About $0.02/GB, billed to the sending region |
| AWS out to the internet | About $0.09/GB for the first tier, after the free allowance |
Charges that come from the service, not the path
Some managed services add their own data charges on top of transfer rates. A NAT gateway is the most common example. It charges an hourly fee plus a data processing fee per GB, and about $0.045/GB is typical. That fee applies to every byte that passes through it, including traffic to AWS services such as S3. Transit Gateway and interface VPC endpoints also bill per GB processed. Later chapters cover each of these.
Because these charges stack, one request can incur several fees. An instance in a private subnet that downloads from the internet pays NAT processing, and then the download itself is inbound, so it is free. An instance that uploads to the internet through the same NAT pays NAT processing and internet egress.
Seeing the model as a map
The distance ordering gives you a quick heuristic. Cost generally rises as traffic travels farther from where it started, so the cheapest fix is often to keep traffic closer to its source.
Common mistakes
- Using public IPs between your own instances. Traffic to a public or Elastic IP address can be billed as data transfer even when both instances are in the same AZ. Use private addresses.
- Forgetting that inter-AZ is billed twice. The charge applies on both the sending and the receiving side, so a 1 GB transfer costs about $0.02 in total.
- Assuming free inbound means a free design. Inbound traffic is free, but the replies, the replication, and the NAT processing around it are not.
What to do next
To reduce transfer costs, first classify your traffic into the categories above. Then find which category is largest. The next chapters cover the specific paths in detail and show how to measure them with Cost Explorer and VPC Flow Logs.
Exercise
An instance in us-east-1a sends 500 GB per month to an instance in us-east-1b using private IPs. At about $0.01/GB in each direction, what does this cost, and how could you make it free?
Show answer
It costs about $10 (500 GB × $0.01 on the sending side plus 500 GB × $0.01 on the receiving side). It becomes free if both instances run in the same AZ and communicate over private IPs, though you give up the availability benefit of spreading across AZs.