Skip to Content

Networking: Amazon VPC

The Amazon VPC building blocks on one map, a one-line summary of each component, and the map of this group.

The VPC components map

An Amazon VPC (Virtual Private Cloud) is an account's own private network in an AWS Region. Almost everything else in AWS (EC2, RDS, Lambda in a VPC, load balancers) lives inside one.

Amazon VPC components: in a Region, a VPC has a public subnet with a NAT gateway and web servers reached through the internet gateway, and a private subnet with app servers and a VPC endpoint; the VPC connects to other networks through VPC peering, Transit Gateway, Site-to-Site VPN and Direct Connect Amazon VPC components: in a Region, a VPC has a public subnet with a NAT gateway and web servers reached through the internet gateway, and a private subnet with app servers and a VPC endpoint; the VPC connects to other networks through VPC peering, Transit Gateway, Site-to-Site VPN and Direct Connect

Everything in this group on one map.

Section summary

  • CIDR: an IP range.
  • VPC: Virtual Private Cloud; it defines a list of IPv4 and IPv6 CIDRs.
  • Subnets: tied to an AZ; each defines a CIDR.
  • Internet gateway: at the VPC level, provides IPv4 and IPv6 internet access.
  • Route tables: must be edited to add routes from subnets to the IGW, VPC peering connections, VPC endpoints…
  • Bastion host: a public EC2 instance to SSH into, which has SSH access to EC2 instances in private subnets.
  • NAT instance: gives internet access to EC2 instances in private subnets. Old; must be in a public subnet, with the source/destination check turned off.
  • NAT gateway: managed by AWS; scalable internet access for private EC2 instances, for IPv4 targets.
  • NACL: stateless subnet rules for inbound and outbound; don't forget ephemeral ports.
  • Security groups: stateful, at the EC2 instance level.
  • VPC peering: connect two VPCs with non-overlapping CIDRs; not transitive.
  • VPC endpoints: private access to AWS services (S3, DynamoDB, CloudFormation, SSM…) from within a VPC.
  • VPC Flow Logs: at the VPC, subnet or ENI level, for ACCEPT and REJECT traffic; helps find attacks; analyse with Athena or CloudWatch Logs Insights.
  • Site-to-Site VPN: a customer gateway in the on-premises data center, a virtual private gateway on the VPC, and a VPN over the public internet.
  • VPN CloudHub: hub-and-spoke VPN model to connect multiple sites.
  • Direct Connect: a virtual private gateway on the VPC and a direct private connection to a Direct Connect location.
  • Direct Connect gateway: Direct Connect to many VPCs in different Regions.
  • AWS PrivateLink / VPC endpoint services: connect services privately from a service VPC to customer VPCs, with no peering, public internet, NAT gateway or route tables; needs a Network Load Balancer and ENIs.
  • Transit Gateway: transitive connections between VPCs, VPN and Direct Connect.
  • Traffic Mirroring: copy network traffic from ENIs for analysis.
  • Egress-only internet gateway: like a NAT gateway, but for IPv6.
  • Network Firewall: protects a whole VPC from layer 3 to layer 7.

The slides also mention ClassicLink, which connected EC2-Classic instances to a VPC. EC2-Classic was retired in 2023, so ClassicLink no longer exists.

In this group

Exam tips

  • Networking questions are about picking the right component: internet access (IGW, NAT), private AWS access (endpoints), VPC to VPC (peering, Transit Gateway), on premises (VPN, Direct Connect), filtering (security groups, NACLs, Network Firewall).

AWS documentation

On this page

Open notes

Spotted a mistake?

These notes are open source. Suggest a fix, or star the repo if they helped you.

Suggest an edit

For AI agents: llms.txt · llms-full.txt