← blog · November 18, 2026

Cloud Data Transfer Costs: Cutting Cross-Zone Traffic, NAT Gateway Charges and Egress

Every arrow on an architecture diagram can be a path billed per gigabyte. Which traffic costs money and why, how to measure it, how to cut it with gateway endpoints and zone affinity, and what breaks along the way.

Compute and disk are the predictable parts of a cloud bill: you pay for the machines you started. Data transfer is different. Every arrow between two boxes on an architecture diagram can be a path billed per gigabyte, and most of those paths appear without anyone deciding to pay for them. Spreading a service across three availability zones, letting a private workload reach object storage through NAT, replicating between clusters: each choice is reasonable on its own, and together they become the fastest growing line on the invoice. This post covers which traffic is billed and why, how to measure it, and what breaks when you try to cut it.

What actually costs money

Pricing details differ between the large providers, but the shape is the same. We are not quoting prices here because they change and vary by region; check your provider's current table. What matters is knowing which paths are billed:

  • Within one availability zone: usually free over private addresses.
  • Across availability zones in the same region: billed on most providers, and on some both the sender and the receiver pay. Every replica you add for high availability lands here.
  • Across regions: more expensive still.
  • Egress to the internet: typically the most expensive item. Ingress is usually free; providers make it cheap to bring data in and expensive to take it out.
  • Managed gateways: NAT gateways, some load balancers and private endpoints charge per gigabyte processed on top of an hourly fee. That is a second meter on a path that may already be metered.

Surprise bills rarely come from the last items. They come from the first ones, because that traffic is "internal" and nobody expects internal traffic to cost anything.

Measure first

Do not optimize on guesses. Data transfer looks like one line on the bill but hides dozens of usage types. Load the detailed billing export (the Cost and Usage Report on AWS, billing export elsewhere) into a query engine and group by usage type. On AWS the usage type names tell you what is billed: DataTransfer-Regional-Bytes is cross-zone traffic, NatGateway-Bytes is data processed by NAT, DataTransfer-Out-Bytes is internet egress.

That tells you how much you pay, not who causes it. For that you need flow logs. Enable VPC flow logs, map source and destination addresses to subnets and subnets to zones, and rank the pairs that move the most bytes. On Kubernetes, pod traffic may show up under node addresses depending on your network plugin, so know how your CNI assigns addresses before you interpret anything. Tools such as Cilium Hubble give you the same mapping at the workload level.

You will usually find two or three dominant sources. Start there; the long tail is rarely worth the effort.

NAT gateways: the easy win

Workloads in private subnets reach the internet through NAT. The catch is that traffic to the same provider's object storage takes that path by default. If an application writes terabytes of backups or logs a day, you pay NAT processing on every gigabyte even though the traffic never leaves the provider's network.

The fix is a gateway endpoint for object storage. On AWS, gateway endpoints for S3 and DynamoDB are free and work by adding a route to your route tables:

resource "aws_vpc_endpoint" "s3" {
  vpc_id            = aws_vpc.main.id
  service_name      = "com.amazonaws.eu-central-1.s3"
  vpc_endpoint_type = "Gateway"
  route_table_ids   = aws_route_table.private[*].id
}

Other managed services (container registry, secrets manager, queues) use interface endpoints, and those are not free: they bill per hour and per gigabyte. Only add them where measurement shows real volume. One interface endpoint per service in a low traffic environment can cost more than the NAT traffic it replaces.

The second NAT trap is placement. If one NAT gateway serves every zone, requests from the other zones pay the cross-zone charge first and the NAT charge second, and they all lose internet access when that one zone goes down. A NAT gateway per zone raises the fixed cost but pays for itself quickly once traffic is significant.

Cross-zone traffic: the price of the architecture

Workloads are spread across zones for availability. The cost is that any service-to-service call may cross a zone boundary. In a system spread evenly over three zones with random load balancing, roughly two out of three calls go to another zone.

Kubernetes can help. The trafficDistribution: PreferClose field on a Service asks the dataplane to prefer endpoints in the client's zone when healthy ones exist:

apiVersion: v1
kind: Service
metadata:
  name: orders
spec:
  selector:
    app: orders
  ports:
    - port: 80
      targetPort: 8080
  trafficDistribution: PreferClose

The field exists in recent releases; older clusters get similar behavior from the service.kubernetes.io/topology-mode: Auto annotation. Check which one your cluster version supports in its documentation.

The same idea applies to the data layer. In Kafka, setting client.rack on consumers together with a rack-aware replica selector on the brokers lets consumers fetch from a replica in their own zone instead of the leader. Pointing applications at a read replica in their own zone gives a similar win for databases.

Pitfalls

Zone affinity breaks load balancing. Keeping traffic local assumes each zone has a proportional share of replicas. With two replicas in one zone, six in another and evenly spread clients, the small zone gets overloaded. The automatic topology mode in Kubernetes disables its hints in that situation, but PreferClose does not always give you the same safety net. Enforce replica spread with topologySpreadConstraints and check that your autoscaler keeps the balance.

Trading availability for cost. The cheapest design is everything in one zone, and some teams quietly drift there. That is a risk decision, not a cost optimization, and it should be written down as one. Agree with the business which services can live in a single zone.

Forgetting compression. Service-to-service JSON, log shipping and replication streams often travel uncompressed. Turning on compression in log agents and gRPC clients can cut traffic several times over for a measurable CPU cost. Compare the CPU price with the transfer price and decide.

Observability data itself. Shipping metrics, logs and traces to another region or an external service generates real egress. Running the collector in the same zone and filtering and sampling there shrinks the data close to its source.

Mismeasuring a CDN. Putting static content behind a CDN reduces egress, but with a low cache hit ratio the CDN asks the origin for every request and you pay twice. Turning on a CDN without fixing cache headers does not save money.

When not to bother

If data transfer is a small share of the total bill, these changes are not worth the engineering time; idle capacity in compute and storage usually offers more. Do not enable zone affinity for low traffic services with few replicas: the gain is small and the imbalance risk is real. And where legal or contractual rules dictate where data lives, cost decisions sit under that constraint.

A practical order: break the bill down by usage type, find the top two or three sources with flow logs, add a gateway endpoint for object storage, place NAT per zone, then move to zone affinity at the service level. Watch the bill for a week after each step; that is the only way to see whether the change actually lowered anything.