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.
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
CIDR and IP addressing
CIDR notation, subnet masks, private vs public IPs.
VPC and subnets
Default VPC, VPC limits, subnets, the 5 reserved IPs.
Internet gateway and route tables
Public subnets and how routing works.
Bastion hosts
SSH into private instances, and modern alternatives.
NAT instance and NAT gateway
Internet access for private subnets, HA, Regional NAT.
NACLs vs security groups
Stateless subnet rules, ephemeral ports.
Flow Logs and Traffic Mirroring
See and copy the traffic in a VPC.
AWS Network Firewall
Layer 3 to 7 protection for a whole VPC.
VPC peering
Connect two VPCs privately; not transitive.
VPC endpoints and PrivateLink
Gateway and interface endpoints, endpoint services.
Transit Gateway
Hub-and-spoke for thousands of VPCs, ECMP.
Site-to-Site VPN
VPN gateways, CloudHub, Client VPN.
Direct Connect
Private lines to AWS, DX gateway, resiliency.
IPv6 in a VPC
Dual stack, egress-only internet gateway.
Networking costs
Data transfer pricing and how to cut it.
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
Detective, Security Hub and Artifact
AWS Security Hub for a central view of security findings and best-practice checks, Amazon Detective for investigating the root cause of findings, and AWS Artifact for AWS compliance reports and agreements.
CIDR and IP addressing
CIDR notation, base IPs and subnet masks, how many addresses a /24 or /16 holds, worked examples, and private vs public IPv4 ranges.