Module Objective: Design an Amazon VPC networking environment — including subnet layout and traffic security — that supports the compute and database layers already added.

Builds on Modules 4–5: This module formalizes the network the compute and database layers actually run inside.

Networking in AWS: An Architectural View

Up to this point, compute and database resources have been discussed somewhat abstractly. This module makes explicit where they actually live: inside an Amazon VPC, whose design determines what can reach them and how.

🔵 Note A VPC should be designed before compute and database resources are placed into it in a real project — this course covers it after Modules 4–5 for pedagogical sequencing, not because it comes last in practice.

Amazon VPC Design

Designing a VPC starts with choosing a CIDR block sized for expected growth, then dividing it into subnets that map to the architecture's actual tiers — a pattern that recurs across nearly every AWS reference architecture.

Design DecisionGuidance
CIDR block sizeSize generously — resizing a VPC's primary CIDR after resources are deployed is disruptive
Subnet-per-AZCreate matching subnets in each AZ used, to support multi-AZ high availability
Tiered subnetsSeparate subnets by tier — web, application, database — not just by AZ
✅ Tip — Plan for Three Tiers, Even If You Start with One A common reference pattern uses public subnets for load balancers, private subnets for application servers, and further-isolated private subnets for databases — planning this layout early avoids a disruptive redesign later.

Public and Private Subnets in the Café Architecture

Applying the public/private subnet distinction from AWS Academy Cloud Foundations to the café case study: the load balancer sits in public subnets, the EC2 application tier sits in private subnets, and the RDS database sits in even more isolated private subnets.

⚠️ Warning — Nothing Sensitive Belongs in a Public Subnet As a rule of thumb, only resources that must be directly reachable from the internet — typically a load balancer or a bastion host — belong in a public subnet. Application and database tiers stay private.

Security Within a VPC

Security groups and network ACLs, reviewed in AWS Academy Cloud Foundations, are applied here layer by layer: each tier gets a security group permitting traffic only from the tier that should be allowed to reach it.

TierShould Accept Traffic From
Load balancer security groupThe internet (ports 80/443)
Application security groupOnly the load balancer's security group
Database security groupOnly the application security group
🔵 Note — This Is Defense in Depth Chaining security group rules this way means compromising the load balancer alone doesn't grant direct access to the database — each tier has to be crossed individually.

VPC Peering and VPC Endpoints

As an architecture grows to span multiple VPCs — for different environments, teams, or accounts — VPC peering and AWS PrivateLink/VPC endpoints provide ways to connect them, or to reach AWS services, without traversing the public internet.

MechanismPurpose
VPC peeringDirect, private network connection between two VPCs
Gateway endpointPrivate connectivity to Amazon S3 or DynamoDB without an internet gateway
Interface endpoint (AWS PrivateLink)Private connectivity to most other AWS services via an elastic network interface
✅ Tip — Endpoints Keep Traffic Off the Internet Using a gateway endpoint for S3 access from a private subnet means EC2 instances never need a route to an internet gateway just to reach S3 — reducing the attack surface.

Content Delivery in the Networking Layer

Amazon CloudFront, reviewed in AWS Academy Cloud Foundations, sits in front of this VPC's public-facing resources, caching content at edge locations and reducing the load and exposure of the origin.

🔵 Note CloudFront is revisited more deeply as a caching strategy in Module 11 of this course.

Key Terms for Module 6

three-tier subnet layout
A VPC design pattern separating load balancer, application, and database resources into distinct subnets
VPC peering
A direct, private network connection between two VPCs
VPC endpoint
Private connectivity from a VPC to an AWS service without traversing the public internet
defense in depth
Layering independent security controls so a single breach doesn't grant full access

Review Questions

  1. Why is CIDR block sizing an important decision to get right at VPC creation time?
  2. In the café architecture's three-tier design, which tier sits in public subnets, and why?
  3. How does chaining security group rules across tiers implement defense in depth?
  4. What problem do VPC endpoints solve that a plain internet gateway route doesn't?