skip to content

On an AWS bill, which network traffic is free and which shows up as a data-transfer charge? Cover traffic between two instances in one Availability Zone, traffic between Availability Zones in the same Region, and traffic out to the internet.

level: middleimportance: must knowfreq 65%

answer

  1. in is free, out is not
  2. the AZ boundary is a billing boundary
  3. charged twice, once per end
  4. private address versus public address
  5. the diagram never shows the toll

basics

~20 s

Inbound internet traffic is free; outbound is charged per gigabyte. Traffic crossing Availability Zones inside a Region is billed in both directions. Same-AZ traffic is free over private IPv4 but charged when it uses public or Elastic IP addresses.

solid answer

~50 s

Three questions decide the charge: does the traffic leave AWS, does it cross an Availability Zone boundary, and does it travel over a private or a public address. Data coming **into** AWS from the internet is free. Data going **out** to the internet is billed per GB on a tiered rate, with a small monthly free allowance per account. Inside a Region, traffic between instances in the *same* AZ over private IPv4 is free, but the moment it crosses an AZ boundary it is metered — and metered on *both* ends, so a gigabyte sent between AZs shows up twice on the bill. Addressing matters independently of distance: if two instances talk over each other's public or Elastic IP addresses, the traffic is charged per GB even inside one AZ, because it is treated as leaving the VPC. Cross-Region traffic is charged at a higher rate again.

go deeper

for a junior

Know that data coming into AWS is free while data going out to the internet is billed per gigabyte, and that a bill line reading 'data transfer' is about network movement, not storage.

for a middle

Be ready to explain the AZ boundary precisely: cross-AZ traffic is metered in both directions, same-AZ private-IPv4 traffic is not, and using a public or Elastic IP re-introduces the charge regardless of distance.

for a senior

Show how you would find the responsible flows — flow log bytes aggregated by address and AZ — and name the usual culprits, such as replication, log shipping and mesh traffic that silently spans zones.

for a principal

Own the trade between paying cross-AZ transfer and the resilience that spreading across zones buys, and set the standard for when a team may optimise placement for cost rather than availability.

## The three questions that decide every network charge AWS network billing looks arbitrary until you realise it answers three questions in order: 1. **Does the traffic leave the AWS network?** If it goes to the public internet, it is egress and it is billed per GB. 2. **Does it cross an Availability Zone boundary?** Inside a Region, the AZ boundary is a billing boundary. 3. **What address did it use?** Traffic sent to a public or Elastic IPv4 address is treated as leaving the VPC, even when the two endpoints are physically adjacent. Everything below is those three rules applied. ## Inbound is free, outbound is not Data transferred *into* AWS from the internet carries no charge. This asymmetry is deliberate and it shapes cost profiles: an ingest-heavy workload (log collection, uploads, backups landing in S3) has almost no network bill, while a delivery-heavy workload (video, images, large API responses, database exports pulled to an office) can have a network bill larger than its compute bill. Outbound to the internet is tiered — the per-GB rate steps down as monthly volume grows — and AWS includes a modest free allowance per month per account, aggregated across services and Regions. As of 2025 that allowance is 100 GB/month, which is meaningful for a hobby project and rounding error for production. Check current pricing rather than quoting a rate from memory; the *shape* is what you are expected to know. ## The AZ boundary is a billing boundary Within one Region: - Same AZ, private IPv4 addresses: **free**. - Different AZs: **charged per GB, in each direction**. That second point is the one candidates miss. Cross-AZ transfer is metered on the sending side *and* the receiving side, so moving 1 TB between AZs produces 2 TB of billed transfer. In most commercial Regions the rate is on the order of a cent per GB each way — small enough to ignore per request, large enough to dominate a bill when a service mesh, a replicating database, or a chatty internal RPC path runs across AZs all day. This is why cross-AZ transfer is such a common surprise: nobody provisions it, nobody sees it in a resource inventory, and it grows with traffic rather than with fleet size. ## Private versus public addressing Distance is not the only variable. Traffic sent to a **public IPv4 or Elastic IP address** is charged per GB in each direction even when both endpoints are in the same AZ, because the packets are routed out through the VPC's internet edge rather than staying on the private path. Two very common ways to trip this: - Hardcoding a public DNS name or public IP for an internal dependency, instead of the private DNS name that resolves to a private address inside the VPC. - Reaching an in-Region AWS service endpoint from a private subnet through a NAT Gateway rather than through a VPC endpoint — you then pay the NAT's own data-processing charge on top. The fix in both cases is to keep the flow on private addressing. ## Cross-Region and edge Traffic between Regions is charged per GB at a higher rate than cross-AZ and is billed on the source side. Cross-Region replication, multi-Region active-active designs, and "just read from the other Region" fallbacks all buy resilience with a recurring transfer bill; that is a legitimate trade, but it should be a decision rather than an accident. Content delivery changes the arithmetic for internet-facing traffic: data transferred from an AWS origin to Amazon CloudFront is not charged, and you pay CloudFront's own (usually lower at volume) egress rates plus request charges instead. The cache hit ratio then decides how much origin traffic you avoid entirely. ## Finding the flows The bill tells you the total; it does not tell you *which* flow produced it. VPC Flow Logs do. A flow log record carries `bytes` alongside `srcaddr`/`dstaddr`, and the `az-id` field lets you attribute volume to an AZ. Aggregating bytes by source/destination pair over a day usually finds the offender in one query — most often a replication stream, a log shipper, a cache miss path, or a load balancer spreading traffic across zones. ``` # conceptual shape of the aggregation you want SUM(bytes) GROUP BY srcaddr, dstaddr, az-id ORDER BY SUM(bytes) DESC ``` ## Why this matters in an interview Data transfer is the line item that is invisible in every architecture diagram. An engineer who can say "this design puts a gigabyte per second across an AZ boundary and that is billed twice" is doing capacity planning; one who assumes "it's all inside the VPC so it's free" will ship it and find out at the end of the month.

  • Does an EC2 instance reading from an S3 bucket in the same Region generate a data-transfer charge?
    No — transfer between EC2 and S3 in the same Region is not charged. But if the instance sits in a private subnet and reaches S3 through a NAT Gateway, you pay the NAT's per-GB data-processing charge for every byte. An S3 gateway VPC endpoint keeps the traffic off the NAT and adds no charge of its own.
  • How would you actually attribute a large cross-AZ transfer charge to a specific service?
    Enable VPC Flow Logs and aggregate the `bytes` field grouped by source and destination address, using the `az-id` field to confirm the boundary crossing. Map the top talkers back to instances or ENIs by private IP. Replication streams, log shippers and internal RPC between services spread across zones are the usual answers.
  • Your team wants to cut egress by putting CloudFront in front of the origin. What decides whether that saves money?
    Cache hit ratio, mostly. Transfer from an AWS origin to CloudFront is not charged and CloudFront's per-GB rates are typically lower at volume, so highly cacheable static content saves substantially. Uncacheable, per-user API responses just move the same bytes through a second billed service plus request charges.

Think of AZ boundaries as toll booths inside a private road network: driving around inside one zone is free, crossing to the next zone charges you at both booths, and leaving the network entirely charges you again on the way out.

saying these in an interview costs you the question

  • Assumes all traffic inside a VPC is free
  • Thinks cross-AZ transfer is billed once, not on both ends
  • Treats a public IP as equivalent to a private IP inside a Region
  • Believes the small monthly free allowance covers production egress
  • Confuses per-GB data transfer with a NAT Gateway's processing charge

context