AWS Subnets

· Updated · 2 min read · AWS Networking and Content Delivery · Cloud service

AWS Subnets are segmented sections within an Amazon Virtual Private Cloud (VPC). They partition the IP address range of a VPC, allowing further segregation of resources and providing a way to organize and manage network traffic within the VPC.

Subnets are associated with specific Availability Zones (AZs) within an AWS Region and can be public or private to organize and secure network traffic:

  • Public subnets: have a route to the Internet via an Internet gateway and assign public IP addresses to their instances making it possible for instances to send and receive traffic from the Internet directly.
  • Private subnets: typically do not have direct internet access and are used for resources that should not be publicly accessible. A NAT Gateway is needed to access the Internet (for example, to download software updates).

AWS regions are separate geographic areas where AWS maintains multiple data centers called availability zones (AZs). Availability zones within a region are isolated from each other in terms of infrastructure to enhance fault tolerance and stability. These zones are interconnected but operate independently, providing redundancy and resilience against failures.

The diagram below corresponds to the tutorial AWS with Terraform: The Essential Guide – AWS Subnets and shows the us-east-1 Region with some of its Availability Zones.

Region
Region
Availability Zone
Availability Zone
VPC
VPC
ditlw-vpc
ditlw-vpc
Availability Zone
Availability Zone
us-east-1b
us-east-1b
Public subnet
Public subnet
Name=ditwl-sn-za-pro-pub-00
Name=ditwl-sn-za-pro-pub-00
Public IPs
Public IPs
us-east-1a
us-east-1a
172.21.0.0/23
172.21.0.0/23
Private subnet
Private subnet
172.21.02.0/23
172.21.02.0/23
No Public IPs
No Public IPs
us-east-1
us-east-1
Name=ditwl-sn-za-pro-pri-02
Name=ditwl-sn-za-pro-pri-02
us-east-1
us-east-1
us-east-1a
us-east-1a
us-east-1b
us-east-1b
Public subnet
Public subnet
Name=ditwl-sn-zb-pro-pub-04
Name=ditwl-sn-zb-pro-pub-04
Public IPs
Public IPs
172.21.04.0/23
172.21.04.0/23
Private subnet
Private subnet
172.21.06.0/23
172.21.06.0/23
No Public IPs
No Public IPs
Name=ditwl-sn-zb-pro-pri-06
Name=ditwl-sn-zb-pro-pri-06
Text is not SVG - cannot display

AWS subnets are closely tied to availability zones (AZs) within a region. Each subnet is associated with a specific availability zone. When creating a subnet, specify the availability zone in which that subnet resides.

This linkage between subnets and availability zones allows:

  • High Availability: Placing subnets in different availability zones enables redundancy and fault tolerance. If one availability zone experiences issues, resources in subnets associated with other availability zones can remain unaffected.
  • Low Latency: Placing resources in subnets within the same availability zone can minimize latency and increase performance as communication within the same AZ typically has lower latency than across different AZs.
  • Optimized Networking: AWS services can automatically distribute traffic across availability zones when subnets are used in conjunction with services like load balancers, ensuring balanced and efficient resource utilization.

Subnets in different availability zones provide a foundational architecture for fault tolerance, performance optimization, and reliable connectivity within an AWS region.

More tutorials that use Subnets

#AWS #AWS Subnet #AWS VPC