AWS Network Architecture Mistakes: The Hidden Cost of Moving Data
Model NAT, endpoints, Transit Gateway and cross-zone or cross-region traffic by actual path, including endpoint break-even calculations.
1. The scenario: a private analytics worker has a surprisingly large bill
An EC2 worker downloads source objects, calls AWS APIs and uploads processed results. Compute is modest, but its subnet sends all default-route traffic to a NAT gateway in another Availability Zone. Another team centralizes inspection through Transit Gateway. Nobody draws the combined route.
Private placement provides useful isolation. The mistake is treating every private path as having identical processing, transfer and availability behavior. A secure design needs an explicit map from source to destination, including the return path.
Calculations use illustrative USD assumptions, decimal GB and a 730-hour month. They exclude taxes and discounts and are not current regional quotes.
2. How it works: routes and DNS determine the bill
For a traditional zonal NAT design, a private instance sends public-destination traffic to a NAT gateway; the gateway translates the connection and uses an internet gateway where appropriate. A gateway in another zone can add a chargeable zone crossing as well as a dependency on that zone. AWS NAT guidance explains the placement tradeoff. Check the chosen NAT offering rather than applying a zonal model to every available configuration.
S3 and DynamoDB gateway endpoints can provide eligible service access through associated route tables without a gateway-endpoint hourly or processing charge. Interface endpoints use private interfaces and their own endpoint-hour and processed-data meters. A single interface endpoint configuration is not automatically sufficient for an entire multi-zone application.
Transit Gateway supplies routed connectivity between attached networks. Attachment hours and applicable data processing are separate from NAT, inspection appliances and transfer. Centralization can simplify governance while adding paid hops.
3. Cost components: separate bytes from processing events
| Meter | Question to answer |
|---|---|
| NAT availability | How many gateways and billable hours? |
| NAT data processing | How many bytes actually traverse translation? |
| Interface endpoints | Which services and endpoint interfaces/AZs? |
| Transit Gateway | Which attachments and chargeable ingress processing? |
| Transfer | Which ordinary AZ, regional or internet legs are billable? |
| Inspection and DNS | Firewall, appliance, resolver and logging costs? |
One GB of payload can encounter several independent meters. Conversely, a meter can have a waiver: do not add a second fee just because two service names appear on a diagram. Use VPC pricing and Transit Gateway pricing for the exact topology.
Endpoint security matters too. A private route does not authorize access. Combine endpoint policy where supported, resource policy, identity permissions and security groups. Confirm DNS resolution from the actual workload network.
4. Where things go wrong
A per-AZ NAT design adds fixed gateway hours but can reduce cross-AZ traffic and avoid a single-zone egress dependency. A single zonal NAT reduces the fixed floor but may add transfer and failure risk. Neither pattern is always cheaper or sufficiently available.
Creating interface endpoints for dozens of seldom-used services can cost more than the NAT processing avoided. Some workloads also need more than one endpoint to operate privately: image retrieval can depend on registry APIs, image layers and other supporting services. Test bootstrapping and updates, not only one successful API call.
Centralized egress can combine Transit Gateway, inspection and NAT processing on the same flow. Route asymmetry can break stateful firewalls and trigger retries. A route-table review should include return routes, propagation, DNS and failover.
Cross-region backups, replication and API calls need their own service-specific pricing. For example, DynamoDB global-table replication currently has a data-transfer exception; that does not make arbitrary database or object replication free.
5. Real-world example: endpoint break-even
Assume the current monthly path processes 20,000 GB through NAT at $0.045/GB. Gateway hours cost $0.045/hour. Of those bytes, 16,000 GB is eligible S3 traffic that can instead use an S3 gateway endpoint in this VPC.
| Component | Current | Gateway-endpoint candidate |
|---|---|---|
| One NAT gateway’s hours | 730 × $0.045 = $32.85 | $32.85 |
| NAT processed bytes | 20,000 × $0.045 = $900.00 | 4,000 × $0.045 = $180.00 |
| S3 gateway endpoint | $0 | $0 |
| Subtotal | $932.85 | $212.85 |
The $720 processing difference assumes the eligible traffic actually changes route. The NAT remains for other dependencies. Applicable transfer, S3 requests and storage are excluded from both columns; changing a route does not erase those meters.
For an interface endpoint comparison, assume two AZ interfaces at $0.01/interface-hour and $0.01/GB, versus avoided NAT processing of $0.045/GB. The new fixed floor is 2 × 730 × $0.01 = $14.60. Break-even on processing alone is $14.60 ÷ ($0.045 − $0.01) ≈ 417.14 GB/month. If NAT hours remain, do not count them as savings. Additional service endpoints multiply that fixed floor.
6. Alternatives and their tradeoffs
Local eligible gateway endpoints can remove unnecessary NAT traversal without changing the application protocol. Interface endpoints can satisfy private connectivity requirements even below a purely financial break-even, but need availability and DNS design.
Distributed egress reduces detours and regional blast radius at the cost of more fixed deployments. Centralized egress improves common inspection and control; allocate its attachment and processing bill to the consumers it serves.
Caching, batching and placing tightly coupled application/data components together can reduce bytes before purchasing a different route. Keep the required failure isolation and residency constraints when doing so.
7. Practical recommendations
Build a traffic ledger with source account, subnet/AZ, resolved destination, request bytes, response bytes and every paid hop. Use VPC Flow Logs, NAT metrics and billing usage types together; accounting records and flow logs have different aggregation and overhead.
Compare gateway hours, processed bytes and transfer separately before and after a controlled route change. Test endpoint policies, image pulls, DNS failure and zone loss. Monitor connection failures so a cheaper path does not introduce retry amplification.
Assign an owner and intended lifetime to each attachment, endpoint and egress deployment. Review low-volume endpoints and abandoned environments as carefully as the largest byte consumers.
8. CloudVectra perspective: allocate the shared path
CloudVectra cost insights helps review networking spend alongside the compute generating it. Cost Centers can represent application ownership and a documented allocation of shared hubs.
A useful operational report separates fixed connectivity cost from marginal processing cost per GB. Anomaly detection can support investigation of changed traffic volume; packet paths, flow logs and routing configuration establish why the volume changed.
Continue the architecture series
- Previous: Microservices on AWS: When Distributed Architecture Costs More Than Expected
- Next: AWS Data Architecture Mistakes: Why Storing and Moving Data Gets Expensive
- Compare the Azure architecture
- Browse Cloud Architecture & Governance