Sub topic 7
Not forgetting data transfer
This chapter assumes you can configure a service in the calculator and turn usage into inputs, as covered in earlier chapters. Data transfer is a common reason an estimate comes in below the real bill. Compute and storage get entered first, and traffic gets skipped because it is not a resource you launch.
Why data transfer gets missed
Data transfer is the movement of bytes between your resources and somewhere else. AWS prices it by direction and by path, not by resource. Most calculator services have a data transfer section inside their configuration, and some services do not show every path. You must think about the traffic yourself.
The three directions that matter most are:
- Data transfer in from the internet to AWS. This is generally free.
- Data transfer out from AWS to the internet. This is usually charged per GB, often in tiers where the rate drops as volume grows.
- Data transfer between locations inside AWS. The price depends on whether the traffic crosses Availability Zones, Regions, or stays in one zone.
Common paths to check
| Path | Typical pricing behavior |
|---|---|
| Internet to AWS | Usually no charge |
| AWS to internet | Per-GB charge, tiered, with a free monthly allowance |
| Between Availability Zones in one Region | Per-GB charge, often billed in each direction |
| Between Regions | Per-GB charge based on the source Region |
| Through a NAT gateway | Hourly charge plus a per-GB processing charge |
| From a CDN to viewers | Separate CDN rate, often lower than direct internet transfer |
Rates change and vary by Region, so read the figures the calculator shows and do not rely on this table for numbers. Use it as a checklist of paths.
Adding transfer to an estimate
Use these steps for each service that sends or receives data:
- Open the service configuration and find its data transfer inputs. For EC2 these are fields such as inbound and outbound traffic and traffic between Availability Zones.
- Enter volumes in a consistent unit, such as GB per month. The calculator lets you choose units, so confirm the unit beside each field.
- For supporting services, add them as their own line items. A NAT gateway, a load balancer, or a CDN distribution has its own price. Its traffic is not covered by the EC2 line.
- Put the lines in the same group as the workload they support, so reviewers can see the whole cost of the application.
Worked example
A web tier of three instances serves 2,000 GB per month to the internet. Instances also send 500 GB per month to a database in another Availability Zone. The python snippet below shows the arithmetic you can use to sanity-check the calculator lines. The rates are illustrative placeholders, not current AWS prices.
def transfer_cost(gb, rate_per_gb, free_gb=0):
"""Monthly cost for billable GB after a free allowance."""
billable = max(gb - free_gb, 0)
return billable * rate_per_gb
# Placeholder rates for illustration only.
internet_out = transfer_cost(2000, rate_per_gb=0.09, free_gb=100)
cross_az = transfer_cost(500, rate_per_gb=0.01 * 2) # charged in each direction
print(round(internet_out, 2))
print(round(cross_az, 2))
print(round(internet_out + cross_az, 2))The internet line dominates. Even so, the cross-zone line is easy to forget, and it grows with every replica and chatty service you add.
Estimating the volumes
You rarely know exact traffic, so derive it from workload numbers:
- Multiply monthly requests by the average response size.
- Use existing metrics, such as load balancer bytes processed or VPC flow logs, when you have a similar running workload.
- Split traffic by path before you total it, since each path has a different rate.
- Add a stated margin for growth instead of rounding silently.
Common errors
- Entering outbound traffic on one service and forgetting the matching load balancer or NAT gateway processing charge.
- Treating all traffic as internet traffic, which overstates cost when much of it stays inside one zone.
- Ignoring the free monthly allowance, or applying it twice across several services.
- Mixing GB and TB in different fields.
Exercise
An estimate includes three EC2 instances and an RDS database in another Availability Zone, and no data transfer lines. Name two data transfer paths you would check and say why the estimate is likely understated.
Show answer
Check traffic from the instances to the internet, which is billed per GB after the free allowance, and traffic between the instances and the database across Availability Zones, which is billed per GB. Without these inputs the estimate counts only the hourly compute and database costs, so it understates the real bill. A NAT gateway or load balancer in the path would also add its own hourly and per-GB charges.