Back to course

Subnets: Public vs Private

AWS Cloud Practitioner to Architect: 0 to Hero

Public vs Private Subnets

Subnets are used to organize resources within a VPC.

Public Subnet:

  • Has a route to an Internet Gateway (IGW).
  • Used for resources that must be reachable from the internet (e.g., Web Servers).

Private Subnet:

  • Does NOT have a direct route to the IGW.
  • Used for resources that should not be exposed (e.g., Databases).
  • Can access the internet via a NAT Gateway (placed in a public subnet).