AWS VPC public vs private subnets is a routing decision before it is a security label. Understanding that distinction makes it easier to build a reachable website, keep application servers away from direct internet access, and diagnose connections without opening unnecessary ports.
This guide follows a small web application from its network sketch to a practical connectivity review. It focuses on common IPv4 designs. IPv6 has different addressing and egress choices, so document it separately when you enable it. Examples are planning illustrations, not a deployment template for every workload.
What makes an AWS subnet public or private?
A public subnet has a route to an internet gateway. A private subnet does not have that direct route. For an EC2 instance to communicate directly through an internet gateway over IPv4, it also needs a public IPv4 address or Elastic IP, plus appropriate security rules. These conditions work together; attaching a gateway to a VPC alone does not make every instance reachable. See the AWS internet gateway guide.
Think of a subnet as a group of addresses with an associated routing policy. Calling it “production-private” is useful documentation, but inspect its actual route table before relying on the name. A later route change can alter the network path without changing the subnet’s label.
For example, a public-facing load balancer can accept customer requests while application instances sit in private subnets. The application tier receives only the traffic it needs from the load balancer. A database can sit behind another restricted boundary. The diagram becomes meaningful when every arrow has a known reason.
Plan the VPC before launching instances
Choose an address range that has room for the expected environment and does not overlap with networks you may connect later. Record existing office, VPN and other VPC ranges before choosing. Renumbering an established environment is a more disruptive exercise than spending time on an address plan at the start.
A subnet belongs to one Availability Zone. For a service intended to tolerate an Availability Zone failure, plan appropriate resources across more than one zone instead of assuming a large subnet provides resilience. AWS explains these boundaries in its VPC creation options.
Create a short inventory with subnet purpose, Availability Zone, CIDR range, route table and owner. Reserve room for future workloads rather than consuming the address space immediately. If containers, managed services or additional network interfaces are expected, include their address needs in the estimate.
Keep development and production changes distinguishable. A learning environment may need only a small topology, but it still benefits from consistent names and an owner. Before selecting AWS account packages, separately confirm which account and Region you are authorized to administer; a package description is not a network design.

Read route tables as a sequence of destinations
For each subnet, identify the route table actually associated with it. Review destination ranges and targets. A default IPv4 route, written as 0.0.0.0/0, covers destinations without a more specific matching route. Do not confuse the default route with permission to access every resource: routing and authorization answer different questions.
Write down the expected route for three representative destinations: another application component, an external update repository and an AWS service. This simple exercise often reveals that one generic “internet access” requirement actually contains several different paths.
Review the AWS route table examples when adding NAT, VPC endpoints or connections to other networks. More specific routes can send traffic somewhere other than the default gateway. Treat every route modification as a change with an intended outcome and a way to verify it.
A useful change record might say: “Allow the application subnet to reach its approved update source through the existing outbound path.” That statement is easier to test than “fix the network.” Keep the original association and route values available so an authorized operator can reverse an incorrect change.
Give private workloads the outbound path they need
A private instance may still need to download packages or call external services. In a common IPv4 design, its internet-bound route targets a public NAT gateway located in a public subnet, whose routing reaches an internet gateway. The application remains without a direct internet gateway route. NAT supports connections initiated from the private side rather than allowing arbitrary inbound connections from the internet. AWS describes the model in how Amazon VPC works.
Decide whether outbound internet access is necessary for each dependency. Some AWS service traffic can use VPC endpoints instead. Endpoint availability, policies and DNS behavior are service-specific, so verify the exact service rather than assuming that one endpoint covers all AWS APIs.
Include resilience and costs in the design review. A production network and a disposable lab may justify different arrangements. Document what happens if a zone or an outbound component becomes unavailable, and estimate the relevant gateway, data processing and transfer charges before deployment.
Separate routing from security controls
Security groups control permitted traffic at the associated resource level. Network ACLs operate at the subnet boundary, and VPC Flow Logs can help investigate network traffic metadata. These tools complement route tables; none makes the others irrelevant. The VPC security overview describes their roles.
Write security requirements in terms of relationships. The application needs requests from the load balancer on its application port. The database needs connections from the application tier on its database port. An administration path needs access from an approved management system. Each requirement should have an accountable owner.
Avoid using broad inbound access as a diagnostic shortcut. It changes the exposure of the workload and can conceal the original mistake. Instead, identify the expected source and destination, inspect the applicable rule and make the smallest justified correction through your normal change process.
Network isolation also does not replace identity controls. An application reaching a service endpoint still needs appropriate permissions for its request. Use the AWS account security checklist for authentication and access foundations alongside the network review.
Troubleshoot an unreachable application methodically
Start by describing the symptom precisely. “The site is down” could mean DNS resolution fails, a TCP connection times out, TLS fails, or the application returns an error. Record the hostname, time, client network and exact response. Different symptoms point to different layers.
- Confirm the destination. Check that DNS points to the intended endpoint and that you are inspecting the correct account and Region.
- Trace the route. Verify subnet associations and the relevant gateway or private connection, including the return path.
- Inspect traffic controls. Compare the actual source, destination and port with the intended security rules.
- Check the workload. Confirm that the service is listening, health checks are meaningful and the operating system permits the connection.
- Use evidence. Correlate flow records, application logs and timestamps before changing another layer.
Consider a deployment where a load balancer is reachable but its targets are unhealthy. The public route is not the first suspect merely because customers see an error. Inspect target registration, application health and communication between the load balancer and its targets. This narrows the investigation without changing unrelated infrastructure.
After a fix, test from the original client path and from an appropriate internal path. Record both successful and intentionally blocked connections. A repair is incomplete if the intended request works only because access was accidentally broadened.
Keep a small network acceptance worksheet
Before launch, list the customer request path, administration path, update path, service API path and backup path. For each, capture the source, destination, protocol, owner, expected outcome and evidence from testing. Include an explicit row for traffic that must fail, such as direct customer access to an internal database.
Review the worksheet after a new integration, routing change or major deployment. A diagram that is never updated quickly becomes misleading. Store configuration definitions and operational notes together, while keeping credentials and sensitive connection details out of public documentation.
Finally, connect network monitoring with application monitoring. A packet reaching an instance does not prove that a customer operation completed. The CloudTrail vs CloudWatch guide explains how change history and operational signals support the same incident investigation.
AWS VPC public vs private subnets: common questions
Does a public subnet expose every EC2 instance?
No. Direct IPv4 internet communication also depends on the instance’s addressing and applicable traffic controls. Check the complete path instead of treating the subnet classification as a complete access assessment.
Can a private subnet access the internet?
Yes, with an appropriate outbound design, such as a public NAT gateway for IPv4. Private means there is no direct internet gateway route; it does not automatically mean that every external dependency is unreachable.
Should a database be placed in a public subnet?
For a typical application, start with a private database access path limited to the components that need it. Assess any different requirement explicitly, including identity controls, network restrictions and operational ownership.
Is a network diagram enough for a launch review?
No. Pair it with actual route and rule checks, connection tests and failure scenarios. The useful result is evidence that required traffic works and unintended traffic remains restricted.
Editorial guide by Mark Biden · Reviewed 18 November 2026. Official sources are linked beside the relevant guidance. OldAccs is independent and is not affiliated with or endorsed by Amazon Web Services. Examples are illustrative; verify the current configuration and requirements of your own environment.

Leave a Reply