VPC Subnet (SUBNET)
Establishes Availability Zone isolation, private IPv4/IPv6 CIDR address sub-allocation, Network ACL (NACL) stateless filtering boundaries, and route table associations.
AWS Container Placement
VPC, AZ
Summary
A sub-allocation of a Virtual Private Cloud (VPC) IP address range bound to a single Availability Zone, serving as the network envelope for compute, database, and container resources.
When to Use (SAA-C03)
Place ALBs, NAT Gateways, and Bastions in Public Subnets; place EC2 app workers, ECS tasks, and RDS databases in Private Subnets.
Allowed Ingress Connections & Ports
| Source Service | Protocol | Port | Architectural Rationale |
|---|---|---|---|
| IGW | TCP, UDP, ICMP | All | Inbound public traffic routed via attached Internet Gateway |
| NAT | TCP, UDP | All | Outbound return traffic from NAT Gateway |
| SUBNET | ALL | All | Inter-subnet VPC routing within VPC CIDR block |
| ALB | HTTP, HTTPS | 80, 443, 8080 | Application Load Balancer traffic forwarding |
Allowed Egress Targets & Ports
| Target Service | Protocol | Port | Data Flow Rationale |
|---|---|---|---|
| SUBNET | ALL | All | Inter-subnet communication governed by Route Table local rule and NACLs |
| RTB | ROUTE | 0 | Packet lookup against associated Route Table |
| IGW | ALL | All | Direct internet egress via public route table |
| NAT | TCP, UDP | 80, 443 | Outbound egress via NAT Gateway in a public subnet |
Key Configuration Parameters & AWS Best Practices
| Parameter | Format / Example | Purpose & Rationale |
|---|---|---|
| IPv4 CIDR Block (cidrBlock) (Required) | 10.0.1.0/24 (251 usable IPs) | The IPv4 network address prefix allocated to the subnet within the parent VPC CIDR boundary. Why: Determines the pool of private IP addresses available for EC2 instances, ENIs, and container pods. Must not overlap with any other subnet in the same VPC. |
| Availability Zone (availabilityZone) (Required) | us-east-1a | The physical AWS Availability Zone where subnet infrastructure resides. Why: Subnets are strictly zonal resources that cannot span multiple Availability Zones; multi-AZ architectures require at least 2 distinct subnets in separate AZs. |
| Subnet Routing Type (isPublicSubnet) (Required) | true | Indicates whether the subnet route table provides a direct route to an Internet Gateway. Why: Determines whether compute workloads can receive direct public traffic or require a NAT Gateway for outbound updates. |
| Auto-Assign Public IPv4 (mapPublicIpOnLaunch) | false | Automatically assigns a public IPv4 address to the primary elastic network interface (eth0) of instances launched into this subnet. Why: Convenient for public bastion hosts or public web servers in public subnets. |
| Custom Route Table ID (routeTableId) | rtb-0123456789abcdef0 | Explicit association of a custom Route Table with this subnet. Why: If omitted, the subnet automatically inherits the VPC Main Route Table. |
| Network ACL ID (naclId) | acl-xxxxxxxxxxxxxxxxx | Stateless subnet packet filter associated with the subnet boundary. Why: Allows creating defense-in-depth network firewalls at the subnet perimeter. |
Practice Labs Using VPC Subnet
Missing Internet Gateway Route
Attach or route default outbound traffic 0.0.0.0/0 to the Internet Gateway in the public route table.…
CLF-02Locked-Out Security Group Ingress
Add an inbound rule allowing TCP port 80 from 0.0.0.0/0 to the web instance Security Group.…
CLF-03Public Database Exposure Vulnerability
Move or configure RDS to be in a private subnet, disable public accessibility, and restrict ingress exclusivel…
CLF-04Single Point of Failure (Single-AZ)
Add a secondary subnet in us-east-1b and front instances with an Application Load Balancer across both Availab…
CLF-06Tight Coupling in Transaction Processing
Decouple the architecture by placing an Amazon SQS queue between the producer and consumer.…
SAA-01FinTech Payment Ledger: $6,750 NAT Gateway S3 Cost Surge
Add an S3 prefix-list destination route in the private route table targeting the S3 Gateway Endpoint.…
Frequently Asked Questions
Where does VPC Subnet live inside an AWS VPC architecture?
Valid container placement: VPC, AZ. Establishes Availability Zone isolation, private IPv4/IPv6 CIDR address sub-allocation, Network ACL (NACL) stateless filtering boundaries, and route table associations.
When should I use VPC Subnet on the AWS SAA-C03 exam?
Place ALBs, NAT Gateways, and Bastions in Public Subnets; place EC2 app workers, ECS tasks, and RDS databases in Private Subnets.
Can I simulate VPC Subnet packet routing without an AWS account?
Yes. CloudTracer simulates VPC Subnet along with 53 AWS services directly in your browser and exports production Terraform HCL.