Lesson 1 of 2 Network Cost Optimization

Identifying Network Charges

This lesson explains what AWS charges for network traffic and how to see it, because network costs are spread across many line items and are easy to overlook.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify the main network charges.
  • Find expensive traffic with Cost Explorer and flow logs.

What is charged

Network costs depend on where traffic flows rather than how much compute is used, so they are easy to overlook until they appear on the bill. Data transfer into AWS from the internet is free. Charges arise when data leaves AWS to the internet, crosses between Regions, crosses between Availability Zones, or passes through a processing service such as a NAT gateway, which charges per gigabyte in addition to any transfer charge. The main charges are listed in the following table. Prices vary by Region and change over time, so the exam tests which traffic is charged rather than exact rates.

Traffic or serviceCharging model
Data transfer out to the internetPer GB, tiered; lower through CloudFront
Data transfer between AZs in a RegionPer GB in each direction (for example EC2 to EC2 in another AZ)
Data transfer between RegionsPer GB out of the source Region
Within one AZ using private IPsFree
NAT gatewayPer hour plus per GB processed (in addition to transfer charges)
Interface VPC endpointsPer hour per AZ plus per GB processed
Gateway VPC endpoints (S3, DynamoDB)Free
Transit GatewayPer attachment-hour plus per GB processed
VPC peeringNo hourly charge; standard cross-AZ or inter-Region transfer charges
Public IPv4 addressesPer hour for every public IPv4 address, attached or idle
Load balancersPer hour plus capacity units (LCU/NLCU)

The following diagram marks the free path in teal and the charged paths in red.

Where network charges arise. Data in from the internet is free. Data out to the internet, between Regions and between Availability Zones is charged, and processing services such as NAT gateways add a per-gigabyte charge on top of any transfer charge. Gateway endpoints for S3 and DynamoDB carry traffic free.
Rates vary by Region; the pattern of free and charged paths is what matters.
Sort into groups

Charged or free?

Exam skills 5.1.4

Decide whether each kind of traffic is charged.

Log in to try this activity Interactive activities are free with an account.

Finding the expensive traffic

Cost Explorer grouped by usage type shows charges such as DataTransfer-Regional-Bytes (cross-AZ), NatGateway-Bytes, DataTransfer-Out-Bytes and PublicIPv4:InUseAddress. Cost and Usage Reports queried with Athena show the resource IDs responsible. VPC Flow Logs with fields such as pkt-dstaddr, flow-direction and traffic-path show which sources and destinations generate the traffic, and NAT gateway CloudWatch metrics (BytesOutToDestination) show volume per gateway. VPC IPAM public IP insights lists public IPv4 addresses by service and whether they are in use.

Match the pairs

Reading the bill

Exam skills 5.1.4

Match each usage type in Cost Explorer with the traffic behind it.

Log in to try this activity Interactive activities are free with an account.
Worked example

Reading the bill

A team's monthly bill shows 40 TB of NatGateway-Bytes and 25 TB of DataTransfer-Regional-Bytes. Flow logs on the NAT gateway ENIs, queried with Athena, show that 90% of NAT traffic goes to S3 IP ranges in the same Region. The cross-AZ traffic comes from application servers in one AZ reading from an ElastiCache primary in another AZ and from private subnets in two AZs routed to a single NAT gateway. Both findings lead directly to the optimisations in the next topic.

Check yourself

Is inbound internet traffic charged?

Show answer

No. Outbound, cross-AZ and inter-Region traffic are charged.

Exam Tips

Remember for the exam

  • Inbound internet traffic is free; outbound, cross-AZ and inter-Region traffic is charged.
  • NAT gateways and interface endpoints charge per hour and per GB processed.
  • Gateway endpoints are free; all public IPv4 addresses are charged hourly.
  • Use Cost Explorer usage types, CUR with Athena and VPC Flow Logs to find costly traffic.