- Regional resource (spans all AZs)
- Max 5 VPCs per region (soft limit)
- CIDR range: /16 to /28
- AWS reserves 5 IPs per subnet (first 4 + last 1)
10.0.0.0/8→ 10.0.0.0 to 10.255.255.255172.16.0.0/12→ 172.16.0.0 to 172.31.255.255192.168.0.0/16→ 192.168.0.0 to 192.168.255.255
- AZ-specific (one subnet = one AZ)
- Public: Has route to Internet Gateway
- Private: No route to internet
- Reserved IPs: .0 (network), .1 (router), .2 (DNS), .3 (future), .255 (broadcast)
- One per VPC
- Enables internet access for public subnets
- Horizontally scaled, HA
- AZ-specific (deploy one per AZ for HA)
- Allows private subnets to access internet (outbound only)
- Managed by AWS
- NAT Instance: EC2-based, cheaper, you manage
- Controls routing for subnets
- Main route table: Default for VPC
- Custom route tables: Explicit associations
- Most specific route wins
- Stateful: Return traffic auto-allowed
- Allow rules only (no deny)
- Instance level
- Default: All outbound allowed, all inbound denied
- Can reference other SGs
- Stateless: Must allow both directions
- Allow AND deny rules
- Subnet level
- Rules numbered, evaluated in order (lowest first)
- Default NACL: Allow all in/out
- Custom NACL: Deny all in/out
| Feature | Security Group | NACL |
|---|---|---|
| Level | Instance | Subnet |
| State | Stateful | Stateless |
| Rules | Allow only | Allow + Deny |
| Order | All evaluated | Number order |
| Applies | Explicit association | All in subnet |
- Connect 2 VPCs (same or cross-region)
- Not transitive (A-B, B-C ≠ A-C)
- No overlapping CIDR
- Update route tables
- Private connection to AWS services (no IGW/NAT)
- Gateway Endpoint: S3, DynamoDB (free, route table)
- Interface Endpoint: Everything else (PrivateLink, ENI, $)
- Hub-and-spoke network topology
- Connect thousands of VPCs
- Transitive routing
- Works with Direct Connect, VPN
- Site-to-Site VPN: On-premises to AWS
- Virtual Private Gateway: VPN endpoint on AWS side
- Customer Gateway: VPN device on customer side
- Encrypted traffic over internet
- Dedicated private connection (not internet)
- Consistent network, reduced costs
- 1 Gbps or 10 Gbps
- Setup takes weeks/months
- Simple: Single resource, no health checks
- Weighted: % traffic to different resources (A/B testing)
- Latency: Lowest latency region
- Failover: Primary/secondary (DR)
- Geolocation: Based on user location
- Geoproximity: Based on resource location (bias)
- Multi-value: Up to 8 healthy records (simple with health checks)
- Monitor endpoints (HTTP, HTTPS, TCP)
- Interval: 30 sec (standard) or 10 sec (fast)
- Threshold: Default 3 consecutive checks
- Can monitor CloudWatch alarms
- A: IPv4 address
- AAAA: IPv6 address
- CNAME: Alias to another domain (not root)
- Alias: AWS resource (can use for root domain)
- CDN (Content Delivery Network)
- 400+ edge locations
- Cache content closer to users
- Origins: S3, ALB, EC2, custom HTTP
- TTL: Default 24 hours
- Geo-restriction: Whitelist/blacklist countries
- Signed URLs/Cookies: Restrict access
- OAI (Origin Access Identity): S3 bucket access only via CloudFront
- VPC: Regional, max 5 per region
- Subnet: AZ-specific, 5 IPs reserved
- IGW: One per VPC, public internet access
- NAT Gateway: Private to internet (outbound)
- Security Group: Stateful, allow only
- NACL: Stateless, allow + deny, subnet level
- VPC Peering: Not transitive
- Transit Gateway: Transitive, hub-and-spoke
- VPN: Encrypted over internet
- Direct Connect: Dedicated private link
- Route 53: DNS, 7 routing policies
- CloudFront: CDN, 400+ edge locations
- Endpoint: Private connection to AWS services