What is it?


Key Concept:


Important Points:

  1. Fixed CIDR Block: Once you assign a CIDR block to a subnet, it cannot be changed, so careful planning is important.
  2. Subnet Size: Choose the size of your subnet based on the number of IP addresses you need (e.g., /24 gives 256 IP addresses).
  3. Isolation: Resources in private subnets cannot be accessed from the internet unless explicitly configured (via a NAT Gateway or VPN).
  4. Communication Between Subnets: Resources within the same VPC (and across subnets) can communicate directly unless restricted by Security Groups or Network ACLs.
  5. NAT Gateway: Use a NAT Gateway in a public subnet to allow private subnets to initiate outbound internet connections while remaining isolated from inbound traffic.
  6. Elastic IPs: Only public subnets can use Elastic IPs to give resources a static, public-facing IP address.

Best Practices / Best Used For:

  1. Separate Public and Private Subnets: Use public subnets for resources that need internet access (e.g., web servers) and private subnets for internal resources (e.g., databases).