Private subnet
A private subnet is a subnet whose resources lack direct connectivity or reachability to the public internet.
Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu
A private subnet is a subnet whose resources are not directly reachable from the public internet.
- How it is used
- Places application services that should not be directly internet-accessible behind an internet-facing load balancer.
- How deep it goes
- Works through CIDR division, public-IP settings, NAT placement, and outbound routing in a Terraform subnet module.
- Examples
- Uses an API container, database, cache, and load balancer, alongside a Terraform public-and-private-subnet module.
- What you can do after
- Build it from scratch with Terraform: divide a supplied CIDR block and configure private-subnet outbound access through NAT.
Secure APIs
A private subnet is a cloud network subnet that lacks direct internet exposure and is intended for internally accessed resources.
- How it is used
- Uses network segmentation to keep internal API services away from direct internet exposure.
- How deep it goes
- Explains isolation, DMZ routing, and cross-segment bridges, but does not specify provider-specific subnet configuration steps.
- Examples
- Shows API gateways and bastion servers in a DMZ protecting private APIs, databases, and developing endpoints.
- What you can do after
- Evaluate network topology by checking internet exposure, DMZ routing, segment bridges, and restricted private access.
Related concepts
- subnetworkkind of · A subnetwork is a logical subdivision of an IP network with its own address range, routing scope, and network configuration.
- NAT gatewayuses · A NAT gateway is a network component that enables private-network resources to initiate outbound connections through address translation without accepting unsolicited inbound connections.
- network address translationuses · Network address translation is a networking technique that rewrites IP addresses and often transport-layer ports as traffic crosses a gateway or network boundary.
- network segmentationconfigured by · Network segmentation is the division of a network into distinct physical or logical zones with controlled communication between them.
- multi-tier applicationused by · A multi-tier application is an application organized into distinct tiers that separate responsibilities and interact through defined dependencies or interfaces.
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.

