Public subnet
A public subnet is a subnet with routing or configuration that permits its resources to connect directly to the public internet.
Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu
A public subnet is a subnet configured with a route that permits direct internet connectivity for its resources.
- How it is used
- Places internet-facing services in a public subnet while keeping application and data services on private networks.
- How deep it goes
- Works through Terraform subnet allocation and public IP settings, while deferring internet-gateway setup to a higher-level module.
- Examples
- Uses a public load balancer in a three-tier application and a Terraform module that creates public and private subnets.
- What you can do after
- Build it from scratch with Terraform as part of a segmented network, while accounting for the separate internet-gateway setup.
Secure APIs
A public subnet is a cloud network subnet with a route or configuration that permits internet connectivity.
- How it is used
- Frames cloud network topology as part of API security threat modeling.
- How deep it goes
- Defines internet access and explains segmentation, but stops short of provider-specific configuration steps.
- Examples
- Illustrates public-subnet design through DMZ diagrams and cloud VPC segmentation.
- What you can do after
- Evaluate how subnet placement affects API exposure and channel inbound traffic through hardened boundary components.
Related concepts
- subnetworkkind of · A subnetwork is a logical subdivision of an IP network with its own address range, routing scope, and network configuration.
- load balancingused by · Load balancing is the distribution of requests or computational work across multiple resources to manage demand, reduce workload imbalance, and improve utilization or availability.
- networkpart of · A network is a system of connected entities and links that enables communication or represents relationships among those entities.
- NAT gatewayhas part · A NAT gateway is a network component that enables private-network resources to initiate outbound connections through address translation without accepting unsolicited inbound connections.
- private subnetcontrasts with · A private subnet is a subnet whose resources lack direct connectivity or reachability to the public internet.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

