0Pricing
AWS Security Academy · Lesson

Public and Private Subnet Design

Separate internet-facing and internal resources within a VPC.

Public and Private Subnet Design is a free AWS Security Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

The VPC Foundation

A Virtual Private Cloud (VPC) is your logically isolated network in AWS. Within it you carve out subnets, ranges of IP addresses tied to a single Availability Zone. How you divide a VPC into subnets is the first and most important security decision, because it determines what can reach what.

Public Versus Private

A public subnet has a route to an internet gateway, so resources in it can be reached from and reach the internet. A private subnet has no direct internet route. The distinction is defined entirely by the route table, not by any property of the subnet itself.

What Goes Public

Only resources that must face the internet belong in public subnets: load balancers, NAT gateways, and bastion alternatives. Keeping this tier minimal shrinks the attack surface. Application servers and databases should never sit in a public subnet where the internet could reach them directly.

What Stays Private

Place application servers, databases, and internal services in private subnets. They can still serve traffic via a load balancer in the public subnet and reach the internet for updates through NAT, but they are never directly addressable from outside, drastically reducing exposure.

The Multi-Tier Pattern

A common secure layout uses three tiers: a public subnet for load balancers, a private app subnet for compute, and a private data subnet for databases. Traffic flows inward tier by tier, and each tier only accepts connections from the one in front of it.

Spanning Availability Zones

For resilience, replicate subnets across multiple Availability Zones (AZs). A public and private subnet pair in each AZ lets load balancers and workloads survive the loss of one zone. This is a high-availability practice that also supports secure, redundant designs.

CIDR Planning

Plan your CIDR blocks so subnets do not overlap and you leave room to grow. Thoughtful, non-overlapping ranges make routing, peering, and security-rule references cleaner. Overlapping CIDRs across VPCs later block peering and complicate connectivity, so plan address space deliberately up front.

Isolation by Design

Subnet design is a security control because it lets you isolate sensitive workloads. A data subnet with no internet route and no inbound path except from the app tier is structurally protected, even before you add security groups. Architecture, not just rules, enforces this boundary.

Subnets and Security Layers

Subnets define where network ACLs apply, since NACLs attach at the subnet boundary. Pairing well-designed subnets with subnet-level NACLs and resource-level security groups gives you the layered, defense-in-depth network model that the SCS-C02 exam expects.

Avoiding Common Mistakes

The classic mistake is placing a database in a public subnet or giving private instances public IPs out of convenience. Both expose resources that should stay internal. Default to private placement and justify every public-subnet resource explicitly.

Why It Matters

Sound subnet design is the backbone of a secure VPC. By separating internet-facing from internal resources and spanning AZs, you build isolation and resilience into the network itself, the foundation that gateways, route tables, and firewalls then build upon.

Quick Check

Apply subnet design reasoning.

Recap

A VPC is divided into subnets tied to Availability Zones. A subnet is public only when its route table reaches an internet gateway; otherwise it is private. Keep only load balancers and NAT in public subnets, and place app and data tiers privately. Use a multi-tier pattern across multiple AZs with planned, non-overlapping CIDRs so isolation is built into the architecture itself.

Frequently asked questions

Is the “Public and Private Subnet Design” lesson free?

Yes — the full text of “Public and Private Subnet Design” is free to read here on the web, and the AWS Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Security Academy course, upgrade to CoddyKit PRO.

What will I learn in “Public and Private Subnet Design”?

Separate internet-facing and internal resources within a VPC. You practise AWS Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start AWS Security Academy?

No prior experience is required. AWS Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Public and Private Subnet Design” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this AWS Security Academy lesson?

Yes. Every AWS Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Public and Private Subnet Design
  2. Internet, NAT, and Egress Gateways
  3. Route Tables as Security Controls
  4. Securing VPC Peering and Transit Gateway
← Back to AWS Security Academy