Keeping the main route table in an Amazon Virtual Private Cloud (VPC) conservative can prevent accidental internet connectivity, but it is not a universal AWS rule that public subnets must never use the main route table. AWS allows main-table routes to be changed and custom route tables to be associated with subnets. What matters is which effective table each subnet uses, where its routes lead and which security controls govern the resources inside it. A safe design is based on explicit traffic requirements and verified associations, not the name of a route table.
Imagine a development team operating a nondefault VPC containing a public application subnet, a private worker subnet and a new data subnet. A new engineer creates the data subnet and forgets to associate a custom route table. The subnet inherits the main route table automatically. If that main table contains broad routes, the new subnet may inherit paths that were never intended for it. Leaving the main table with only necessary local routing can reduce this particular risk. The following walkthrough explains the protective pattern and its limits rather than repeating an unsupported blanket prohibition.
Identify the main route table and implicit associations
Each VPC includes a main route table. Every subnet must have an effective subnet route table: it may be explicitly associated with a custom or main table, or it implicitly uses the main table when no explicit association exists. Multiple subnets can share one table, but each subnet has just one effective table at a time. This is core Amazon VPC routing behavior. Before making a change, identify the table marked Main and list both explicit and implicit subnet associations; otherwise an administrator may modify routing for more workloads than the intended target.
A newly created nondefault VPC commonly starts with a main route table containing only the local VPC route. Yet a VPC created through a console workflow that provisions gateways can acquire additional routes. A default VPC has its own internet-facing defaults. Therefore do not infer main-table contents from an account’s history or the subnet’s display name. Examine the actual destination prefixes and targets in the AWS VPC console or supported APIs, including both IPv4 and IPv6. The current routes, not their labels, determine the paths available to a subnet.
A local route enables communications within the supported VPC CIDR ranges. It does not establish security isolation between application and database tiers. Understanding CIDR address ranges is important because a broad local destination can include several internal subnets. Security groups and other applicable controls still determine whether a resource can accept a particular connection. A table with only the local route may prevent direct external egress, but it does not automatically deny unwanted east-west access within the VPC.
AWS permits adding, removing and replacing eligible routes in the main route table. The main table itself cannot simply be deleted while serving that role, but its designation can be moved to another suitable table. Doing so changes the route-table default for subnets that depend on an implicit association, while explicit subnet associations remain in effect. A change that looks like a small administrative cleanup may interrupt database connections, application updates or hybrid routes. Treat it as a network change requiring inventory, validation and a reversible plan.
Use a local-only main table as a guardrail, not a mandate
One defensible security pattern is to keep the main table near its conservative default and explicitly associate the public, worker and data subnets with appropriate custom route tables. AWS documentation describes this as one way to protect a VPC. When a subnet is newly created without an explicit association, it does not inherit a generic internet-gateway route. This makes a missing association less likely to create unexpected external connectivity. It does not replace resource security groups, IAM permissions or an application-layer authorization check.
The opposite is not automatically forbidden. A VPC can intentionally use a main route table with an internet gateway route for subnets that are supposed to be public. The risk then shifts to newly created subnets that inherit that routing. If an organization chooses this arrangement, it should control subnet creation and review address assignment and security-group behavior carefully. The rule should be stated as “avoid unintended implicit routes,” not “never place an internet route in the main table.” Whether a particular pattern satisfies a governance policy depends on the real requirements and controls.
For a small lab, consider VPC 10.60.0.0/16, public subnet 10.60.1.0/24, private workers 10.60.11.0/24 and a database subnet 10.60.21.0/24. Keep the main table local-only, create a public custom table with a 0.0.0.0/0 route to an internet gateway, and associate the public subnet explicitly. Create a worker table with the approved outbound route and a data table containing only the required local or private service destinations. Associate those subnets explicitly and document the owner of each route.
Note what this example does not prove. A public route does not give an instance a public IPv4 address; addressing and relevant security rules are separate. A data subnet with no default internet route may still communicate locally with a worker subnet. Network ACLs or security groups can reject a connection even when the route is present. Good evidence therefore includes permitted and denied traffic tests, not merely a screenshot showing three differently named route tables.
Read private egress and cross-VPC paths deliberately
An application’s public entry point may be a load balancer in public subnets, while its private workers receive connections only from that load balancer. If the workers need outbound IPv4 internet traffic, they can use an appropriate NAT gateway path. Current AWS provides zonal and regional NAT availability options, so avoid assuming that every multi-zone design requires one particular NAT pattern. The NAT gateway configuration depends on supported mode, target Region, resilience requirements and charges. A NAT gateway translates traffic; it is not an application authorization policy or a firewall for every possible destination.
A private instance may only need access to S3 or other supported AWS APIs. In that case a suitable VPC endpoint can provide a more targeted network path than universal internet egress. Endpoint routes and permissions must be configured correctly; an S3 gateway endpoint changes relevant route-table paths but does not automatically authorize reading every object. An API-level AccessDenied response is different from a missing route. Don’t add 0.0.0.0/0 to the main table simply to make a denied AWS service call succeed.
Hybrid and inter-VPC connectivity require similarly explicit destinations. A route toward a VPC peering connection only provides the configured address path; it does not bypass the need for compatible routes and security controls in both VPCs. Peering also does not create general transitive routing between further peers. VPN and Transit Gateway configurations have their own routing and propagation behavior. Review actual CIDR overlap and return paths when a connection fails rather than assuming the main table is always the missing component.
If a worker subnet routes to a private database across the VPC local path, the database may need no generic internet route at all. But the worker might need DNS and outbound connections for updates. Identify those distinct dependencies before choosing subnet associations. A useful route matrix records source, destination, target, affected subnet and system owner. It becomes a practical document when a new operator must decide whether a route is safe to add, not just a diagram whose colors imply security.
Keep route selection and packet filtering separate
Security groups control allowed traffic at the relevant resources and are stateful: return traffic from a permitted connection is allowed. Network ACLs operate at subnet boundaries and are stateless, so stricter rules may need explicit response-port allowances. The relationship between security groups and network ACLs matters because a route can exist while a connection still fails. Conversely, placing a database in a subnet with a local route does not require accepting arbitrary traffic from the entire VPC.
For the lab, permit HTTPS to an intended entry point, allow worker application traffic only from that entry point’s security group, and allow database traffic only from the worker group’s appropriate port. If a worker instance has an IAM role, scope its cloud API permissions separately from these network rules. Hiding an administrative endpoint behind a private route does not grant authorization or guarantee that it cannot be reached from a connected corporate network. Test the identity and the path together where the application requires it.
A VPC route-table change can interrupt existing connections, and AWS advises checking that new associations preserve the required routes to the same targets. Do not change a production subnet’s association solely to make an infrastructure policy scanner green. Create and test the target custom table first, assess the affected workloads, and schedule the update through normal change controls. Preserve the original configuration so a rollback can restore both the table association and any routes needed for the prechange application state.
For a negative test, attempt a connection from a deliberately unauthorized test client to the private database. It should be rejected even though both subnets may share the VPC local route. Then introduce a route or security-group misconfiguration in an isolated test environment and observe which layer blocks the packet. Distinguishing “no route,” “packet denied,” “port not listening” and “application authorization failure” is the difference between an effective diagnosis and opening broad access in frustration.
Audit and change main-table routing without surprises
Begin with a read-only inventory of route tables and their subnet associations. Identify every implicit association, every explicitly associated subnet, the main route destination and any public, NAT, endpoint, peering or hybrid routes. A main table may serve workloads that are invisible in a list of explicit associations, so check the relevant VPC’s subnets directly. Use the actual route-table ID and route contents rather than relying on the name an earlier administrator assigned.
When changing an implicit association, first create or update the desired custom table and test it on a safe subnet. Then explicitly associate the intended subnet and validate its effective route and access paths. Reachability Analyzer can statically analyze supported resource paths and identify blocking network configuration, but it does not send a full application request or prove that the destination is healthy. Corroborate it with permitted end-to-end tests, and capture a rollback path before expanding the change to multiple subnets.
Changing which route table is main affects the default for all implicitly associated subnets and future subnets that lack explicit associations. AWS recommends testing the replacement table’s routes as a custom configuration before changing its main designation. Review network dependencies that may not be obvious from the table: a database may access a private endpoint, a monitoring agent may need an allowed service route, and an application may rely on a corporate VPN. A security change is only complete when legitimate paths continue to work.
Administrative changes to routes and associations can be reviewed through AWS CloudTrail where the relevant management events are collected. For network behavior, VPC Flow Logs and Amazon CloudWatch can help diagnose accepted or rejected flows and application-level symptoms. A Flow Logs ACCEPT entry is not proof that the application successfully answered a request; a missing route and a 403 response are different faults. Use the evidence to narrow the failing layer rather than granting an internet route that may mask the problem.
Evaluate the security objective instead of repeating an exam slogan
A practical review should ask whether a newly created subnet can inherit a route broader than intended, whether every important subnet has a known effective table, whether public resources have appropriate addressing and controls, and whether private resources can reach required dependencies without universal egress. The conservative-main-table pattern is a useful default in many nondefault VPCs, but it is only one part of that assessment. An intentional public main-table design can be supported when its inheritance and security consequences are understood.
The worked example succeeds when the public entry point is reachable as intended, private workers reach only approved destinations, database access is appropriately restricted and a newly created unassociated subnet does not silently gain an unwanted path. Validate these outcomes in a dedicated test VPC with both positive and negative requests. Preserve route-table preimages and an exact restoration method. The presence or absence of a particular route-table label is not a substitute for those acceptance checks.
AWS VPC routing is safest when associations are explicit, destinations have documented purposes and network permissions are tested separately from packet paths. Keep the main table conservative where that protects against accidental inheritance, but do not present isolation as a universal AWS prohibition. Make the design understandable enough that the next engineer can explain which route a subnet uses, why that route exists and what will happen if it changes.