teluzia.Cloud Engineer · Day 45
CHAPTER 07 · AWS VPC AND NETWORKING

Internet gateways and NAT cost concepts

4–5 hours including independent practice3 topics
LET’S MAKE THIS SIMPLE

What you’re learning today

Compare internet gateways and NAT gateways by traffic direction and billing drivers. You will model a private app’s outbound path and calculate an illustrative estimate using clearly hypothetical rates. No gateway is created; current real rates must be taken from official pricing for a selected Region. An internet gateway attaches to a VPC and supports internet communication for appropriately addressed and routed resources. For IPv4, an instance needs a public IPv4 address or Elastic IP along with the route and filtering. The gateway does not initiate traffic or bypass security groups. IPv6 has a different addressing model. A public NAT gateway enables private IPv4 clients to initiate internet connections when placed in a public subnet with an Elastic IP and an internet-gateway path. Private-subnet routes point to it. NAT does not accept arbitrary unsolicited inbound requests as an application load balancer would. Consider zone placement and failure dependencies.

Think of it this way

An internet gateway is the public gate; NAT is a return-address desk for private clients sending requests outward.

TOPIC 01 / 03Step by step

Internet gateway prerequisites

An internet gateway attaches to a VPC and supports internet communication for appropriately addressed and routed resources. For IPv4, an instance needs a public IPv4 address or Elastic IP along with the route and filtering. The gateway does not initiate traffic or bypass security groups. IPv6 has a different addressing model. A public instance sends through a route targeting the internet gateway; a private-only IPv4 instance cannot use that same direct route as if its private address were globally routable. Separating gateway attachment, routes and addressing explains internet failures precisely and prevents treating one network object as a universal connectivity switch for every resource placed inside the VPC. Attaching a gateway without adding the appropriate route and address leaves the path incomplete; inspect all prerequisites before opening extra firewall ports to repair unrelated routing or addressing failures.

WORKED EXAMPLE
A public instance sends through a route targeting the internet gateway; a private-only IPv4 instance cannot use that same direct route as if its private address were globally routable.
Why this matters

Separating gateway attachment, routes and addressing explains internet failures precisely and prevents treating one network object as a universal connectivity switch for every resource placed inside the VPC.

A common trap

Attaching a gateway without adding the appropriate route and address leaves the path incomplete; inspect all prerequisites before opening extra firewall ports to repair unrelated routing or addressing failures.

Read all topics in this lesson

A complete reference to revisit alongside the guided steps above.

Internet gateway prerequisites

An internet gateway attaches to a VPC and supports internet communication for appropriately addressed and routed resources. For IPv4, an instance needs a public IPv4 address or Elastic IP along with the route and filtering. The gateway does not initiate traffic or bypass security groups. IPv6 has a different addressing model. A public instance sends through a route targeting the internet gateway; a private-only IPv4 instance cannot use that same direct route as if its private address were globally routable. Separating gateway attachment, routes and addressing explains internet failures precisely and prevents treating one network object as a universal connectivity switch for every resource placed inside the VPC. Attaching a gateway without adding the appropriate route and address leaves the path incomplete; inspect all prerequisites before opening extra firewall ports to repair unrelated routing or addressing failures.

WORKED EXAMPLE
A public instance sends through a route targeting the internet gateway; a private-only IPv4 instance cannot use that same direct route as if its private address were globally routable.

Why this matters

Separating gateway attachment, routes and addressing explains internet failures precisely and prevents treating one network object as a universal connectivity switch for every resource placed inside the VPC.

A common trap

Attaching a gateway without adding the appropriate route and address leaves the path incomplete; inspect all prerequisites before opening extra firewall ports to repair unrelated routing or addressing failures.

NAT outbound behavior

A public NAT gateway enables private IPv4 clients to initiate internet connections when placed in a public subnet with an Elastic IP and an internet-gateway path. Private-subnet routes point to it. NAT does not accept arbitrary unsolicited inbound requests as an application load balancer would. Consider zone placement and failure dependencies. Private-app subnet route 0.0.0.0/0 targets NAT; NAT’s own public subnet has an internet-gateway route. The reply is associated with the initiated translation instead of exposing a listening application endpoint for arbitrary internet clients. Tracing both subnets makes NAT architecture comprehensible and reveals whether a missing internet-gateway route, security policy or zone dependency is actually responsible for failed outbound traffic. Routing a private subnet to a NAT gateway whose public path is incomplete cannot provide internet access; inspect the NAT subnet’s route and gateway state rather than only the originating subnet’s default.

WORKED EXAMPLE
Private-app subnet route 0.0.0.0/0 targets NAT; NAT’s own public subnet has an internet-gateway route. The reply is associated with the initiated translation instead of exposing a listening application endpoint for arbitrary internet clients.

Why this matters

Tracing both subnets makes NAT architecture comprehensible and reveals whether a missing internet-gateway route, security policy or zone dependency is actually responsible for failed outbound traffic.

A common trap

Routing a private subnet to a NAT gateway whose public path is incomplete cannot provide internet access; inspect the NAT subnet’s route and gateway state rather than only the originating subnet’s default.

Cost drivers and alternatives

NAT gateway pricing includes time and data-processing dimensions, with other transfer charges possible. Cross-AZ routing can introduce cost and resilience trade-offs. Service endpoints can avoid a NAT path for eligible traffic, but interface endpoints have their own charges. Removing traffic from NAT and deleting an idle NAT are different savings. At hypothetical rates h=0.05 per hour and g=0.05 per GB, 10 hours and 2 GB produce 0.60 before other charges; this is teaching arithmetic, not a current AWS price or a promise of total cost. Unit-based modeling exposes idle hourly cost as well as traffic cost and helps decide whether an endpoint, short-lived gateway or no internet egress better fits a specific workload’s documented connectivity needs. Assuming an idle NAT is free overlooks hourly charges; record current regional rates and remove unneeded gateways after the experiment rather than relying on low traffic or a stopped EC2 instance to end networking billing.

WORKED EXAMPLE
At hypothetical rates h=0.05 per hour and g=0.05 per GB, 10 hours and 2 GB produce 0.60 before other charges; this is teaching arithmetic, not a current AWS price or a promise of total cost.

Why this matters

Unit-based modeling exposes idle hourly cost as well as traffic cost and helps decide whether an endpoint, short-lived gateway or no internet egress better fits a specific workload’s documented connectivity needs.

A common trap

Assuming an idle NAT is free overlooks hourly charges; record current regional rates and remove unneeded gateways after the experiment rather than relying on low traffic or a stopped EC2 instance to end networking billing.

KEEP THESE WITH YOU

Today’s takeaways

Trace the complete gateway chain.

Estimate time and data separately.

Compare endpoint and egress alternatives.

CLOSE THE LOOP

Ready to complete this day?

Verify the practical steps and pass the knowledge check (at least two thirds correct).

Lab steps verifiedKnowledge check passed