Back to Terraform

AWS Networking: VPCs, Routes, Security Groups and Private Endpoints

November 6, 2026 Wasil Zafar 29 min read

Model private connectivity and egress with explicit subnet, route and security-rule ownership

Table of Contents

  1. Draw the Packet Path Before the Resource Graph
  2. Choose Availability Zones and CIDRs Through Stable Inputs
  3. Give Routes and Security Rules One Authoritative Owner
  4. Use VPC Endpoints and Private DNS with Real Access Policies
  5. Test One Allowed Path and One Denied Path

Draw the Packet Path Before the Resource Graph

A VPC is a routing domain with two stories, not a box on a diagram. One story is the request that arrives at the workload; the other is the request the workload sends onward. Every networking incident is a failed hop in one of them, and each hop has a different owner, a different log and a different fix.

Addresses come first, because they constrain everything after. A VPC owns one IPv4 range, and each subnet takes a slice of it inside exactly one Availability Zone. AWS reserves five addresses in every subnet for the network, the VPC router, the DNS resolver, future use and broadcast, so a /20 leaves 4,091 usable addresses. Sizing is a capacity decision made once and paid for later.

Ingress makes four decisions in a fixed order. The internet gateway accepts the packet, the VPC router looks up the subnet's route table, the interface's security group is evaluated, and a process must be listening. A missing route drops the packet before any rule is read; a missing rule drops it after the route succeeded. Both look like a timeout from the client.

Route before rule

The route table is consulted before the security group, so a missing route and a denied rule both surface as a timeout. Find which hop failed before editing either one; widening a rule cannot fix a subnet with no path.

A public subnet is public because of its route table. The name is a label a human typed. A subnet is public when its associated table sends 0.0.0.0/0 to an internet gateway and the resource also holds a public address. Renaming changes nothing; reassociating the table changes everything.

Public is a route, not a name

A subnet is public only when its table sends the default route to an internet gateway and the resource has a public address. The label is documentation; the association is the control, so review the table when someone asks whether a subnet is exposed.

Egress is a separate path with a separate bill. A private subnet's table sends 0.0.0.0/0 to a NAT gateway that lives in a public subnet and holds an elastic IP. The gateway is stateful and accepts only connections opened from inside, so return traffic needs no inbound rule. It is billed per hour and per gigabyte in every zone where it exists.

Service traffic should not take the NAT path at all. S3 and DynamoDB are reachable through a gateway endpoint, which adds a prefix-list route to the tables you choose and costs nothing. Most other services use an interface endpoint, which places an elastic network interface in selected subnets and is billed hourly. Neither removes the need for authorization.

Four boundaries decide one packet. A route table answers whether a path exists, a security group answers whether this connection is allowed, a network ACL answers whether the subnet permits the traffic, and IAM or an endpoint policy answers whether the principal may act. They are independent, so a packet can pass three and die at the fourth.

Four independent gates

Route, security group, network ACL and authorization each make a separate decision. Passing three proves nothing about the fourth, which is why an allowed-path test and a denied-path test belong in the same acceptance run.

Read the error before you read the configuration. A hang usually means no route or a silent security-group drop. A refusal means the packet arrived and nothing was listening. A name that will not resolve inside the VPC points at DNS settings rather than at reachability.

Draw the Packet Path Before the Resource Graph
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
    C["Client
203.0.113.10"] --> IGW["Internet gateway
VPC edge"] IGW --> RT1{"Public route table
0.0.0.0/0 to igw?"} RT1 -- "no route" --> D1["Dropped before the subnet
timeout, no group log"] RT1 -- "route exists" --> SG1{"ALB security group
443 from the client?"} SG1 -- "no matching allow" --> D2["Dropped at the interface
timeout, no app log"] SG1 -- "allow" --> ALB["ALB node
public subnet"] ALB -- "second connection" --> SG2{"App security group
8443 from alb-sg?"} SG2 -- "no matching allow" --> D2 SG2 -- "allow" --> APP["App interface
private subnet"] APP --> RT2{"Private route table
destination?"} RT2 -- "0.0.0.0/0" --> NAT["NAT gateway
public subnet and EIP"] NAT --> NET["Internet
outbound only"] RT2 -- "s3 prefix list" --> VPCE["S3 gateway endpoint
no NAT, no charge"] classDef primary fill:#132440,color:#ffffff,stroke:#0b172b; classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a; classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f; classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420; classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f; class RT1,SG1,SG2,RT2 primary; class IGW,ALB,NAT secondary; class APP,VPCE,NET ok; class C warn; class D1,D2 danger;

Figure 1 separates reachability from permission. The route lookup happens in the VPC router before the packet reaches the subnet, the group is checked at the interface, and the balancer opens a second connection that is a new decision. The two red nodes are the same client symptom with different owners, which is why "the app is down" is not a diagnosis.

The egress half has the same shape in reverse. The application's table decides between the NAT gateway and the S3 prefix-list route, so the same call can be free on Tuesday and metered on Wednesday if an association changed. Every arrow in the diagram is an object someone can edit, and each one should be findable from an address in the state.

A packet entering a VPC and leaving it, with route, security group and policy boundaries A client reaches an internet gateway, then the public subnet route table, then the load balancer security group and the load balancer. The balancer opens a second connection through the application security group to the application interface in the private subnet. Egress goes to the NAT gateway or to an S3 gateway endpoint by prefix-list route. One packet, two route lookups and two security groups INTERNET PUBLIC SUBNET · /20 PRIVATE SUBNET · /20 SERVICE Client one source IP Internet gateway VPC edge SG 443 ALB listener 443 SG 8443 App interface listener 8443 · private address second connection from the balancer route: 0.0.0.0/0 to igw route: 0.0.0.0/0 to nat NAT gateway public subnet app opens the connection elastic IP, outbound only S3 gateway endpoint prefix list 1 · Route table reachability: is there a path at all 2 · Security group permission: is this connection allowed 3 · IAM or endpoint policy authorization: may this principal act A packet must pass all three. The error text names the layer that said no.

The strip at the bottom of Figure 2 is a review checklist, not decoration. Route, group and policy each answer a different question, and each usually belongs to a different owner. When a change request names only one of them, the other two are being changed by accident or not at all. That is the difference between a network that is understood and one that merely works.

Choose Availability Zones and CIDRs Through Stable Inputs

An Availability Zone name is an alias, not a location. AWS maps eu-west-1a to a different physical zone in different accounts, so two stacks in the same letter can sit in different buildings. The zone ID, such as euw1-az1, is the portable handle. Inside one account the names are consistent; across accounts, peering partners and disaster-recovery stacks, only the ID travels.

Pick zones from a data source, then pin the result. The availability-zones data source returns names, IDs and state for the region. Filter to available zones, choose once, and keep the chosen IDs in a described variable. Selecting "the first three" at apply time works until the region gains a zone and the plan silently rewrites itself.

Compute subnet ranges instead of typing them. cidrsubnet takes the VPC prefix, a number of new bits and a net number, and returns one slice. With a /16 VPC and four new bits each subnet is a /20, so the net number becomes the only value a reviewer has to verify. Hand-written ranges drift the moment a fourth zone appears.

Describe the subnets as data, not as repeated blocks. A map keyed by a stable name, holding the zone, the net number and the tier, lets one resource create every subnet and one association bind every table. The key is also the reference used everywhere else, so a rename appears as a diff rather than as a silent replacement.

Let validation catch what it can, and the API catch the rest. Variable validation can prove that the prefix parses and sits between /16 and /28, the range AWS accepts for a VPC. It cannot prove the slice is unused, because that answer belongs to the account. Validation narrows the failure surface; it does not replace the API's own check.

Leave room for the parts that grow. A /28 leaves eleven usable addresses and suits a single endpoint interface, not a load balancer that has to scale. AWS recommends a /27 or larger for load-balancer subnets, and a NAT gateway needs its own address in each public subnet it serves. This is the cheapest moment to be generous.

Use the same key for a resource and its association. A subnet created from a map entry should be associated with a table derived from the same entry. When the association is written by hand with a copied ID, Terraform has no reference to follow, and the apply order becomes a coin toss.

Choose Availability Zones and CIDRs Through Stable Inputs
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
    V["var.vpc_cidr
10.40.0.0/16"] --> VAL{"Valid CIDR
between /16 and /28?"} VAL -- "no" --> E1["Plan fails in validation
no API call is made"] VAL -- "yes" --> AZ["Availability zones data source
names plus zone IDs"] AZ --> PIN{"Selection key?"} PIN -- "zone name" --> W["Portable in one account only
peering and DR drift"] PIN -- "zone ID" --> MAP["Subnet map
key, zone, netnum, tier"] MAP --> CIDR["cidrsubnet per entry"] CIDR --> DUP{"Netnum unique
inside the VPC?"} DUP -- "no" --> E2["Overlapping range
API rejects the subnet"] DUP -- "yes" --> SUB["Subnets created per key"] SUB --> SIZE{"Prefix fits
the workload?"} SIZE -- "no" --> E3["Eleven usable addresses
balancer cannot scale"] SIZE -- "yes" --> OK["Association from the same key
one owner, one order"] classDef primary fill:#132440,color:#ffffff,stroke:#0b172b; classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a; classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f; classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420; classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f; class VAL,PIN,DUP,SIZE primary; class AZ,MAP,CIDR,SUB secondary; class OK,V ok; class E1,E2,E3 danger; class W warn;

Every branch in Figure 3 is cheaper to fix before the apply. A bad prefix fails in validation with no API call, an overlap fails at the API with a rejected subnet, and an undersized block fails months later as a balancer that cannot add a node. Only the third one pages someone at night, which is why the first two branches deserve the effort.

A zone ID also survives an account boundary. Two accounts that must place resources in the same physical zone cannot compare names, because the letters point at different buildings. They can compare IDs. Write the ID into the variable description, and the pairing becomes checkable rather than assumed.

Give Routes and Security Rules One Authoritative Owner

Terraform offers two shapes for the same AWS object, and mixing them creates two owners. A route table can carry inline route blocks, and a route can also be a standalone resource. Both write the same underlying entries, so the question is never which one is "correct" but which one owns the table.

Inline routes are a set; standalone routes are entries. The inline form treats the declared list as the complete contents and removes a route it no longer sees. The standalone form adds or removes exactly one route and ignores the rest. Point both at one table and each apply quietly undoes the other's work.

Choose the shape by who changes the table. A platform stack that owns an entire table can declare its routes inline and keep one reviewable block. A table shared with a service team needs standalone resources so every route has an address in state and a separate owner. Mixing them is the only genuinely wrong answer.

Security groups have three spellings. Inline ingress and egress blocks on the group, the older single-rule resource, and the current per-rule resources are all in the provider. The last pair is what a 6.x configuration should use when the group is shared or when rules are reviewed individually.

The provider will not save you from the conflict. Its documentation warns against combining inline blocks with standalone rule resources on the same group. The plan may succeed, the group may show the union of both, and the next apply may take a rule away. That oscillation is a design error, not flaky infrastructure.

An identifier for a rule is a tuple, not a description. Protocol, port range and source, whether a CIDR or a referenced group, define the rule. AWS merges identical tuples, so two modules can each believe they own a rule that exists once. Removing either module's copy removes access the other one assumed.

Reference groups rather than addresses. For balancer-to-application traffic, allow the balancer's group as the source. That follows node replacement without editing CIDRs, and it records the dependency in the rule itself. A hard-coded subnet range survives exactly until the next scaling event.

Associations are ownership too. A subnet is bound either by an explicit association or by falling through to the VPC's main table. If half the subnets are explicit and half are implicit, a change to the main table is invisible in the plan of the stack that owns it. Choose one model and make the exception loud.

Default resources are shared resources. A new VPC arrives with a default security group that allows traffic among its members and a main route table that every unassociated subnet uses. Adopting either means accepting whatever else lands in the VPC. Create dedicated groups and tables, and leave the defaults alone.

Stateless ACLs need the return ports. If a network ACL is in scope, it must permit the ephemeral ports in both directions, because it keeps no connection state. A rule that admits 443 inbound but not the response range produces the classic half-open connection that looks like an application timeout.

Make the ownership visible in review. A plan that adds a route nobody wrote means another state owns that table. Reading the state addresses shows whether the table carries inline routes or whether a route resource exists beside it. Two addresses for one table is the signal to stop and reconcile.

Order comes from references, not from intention. Terraform's graph follows values it can see. An association that receives a literal subnet ID from a variable has no edge to the subnet, so the apply order is luck. Pass the object, or pass the key that indexes it.

This article targets Terraform 1.17.1 and hashicorp/aws 6.72.0. The per-rule security group resources and the inline-block warnings are the 6.x schema. Configurations copied from older examples often mix inline blocks with standalone rules, which is exactly the combination the current documentation warns against.

Use VPC Endpoints and Private DNS with Real Access Policies

A VPC endpoint is a private door to a public service, not a permission. It removes the internet hop while leaving the identity check in place. Two shapes matter: gateway endpoints for S3 and DynamoDB, and interface endpoints for almost everything else.

A gateway endpoint is a route, and nothing more. It has no interface, no security group and no hourly fee. Enabling one adds a prefix-list route to the tables you name, so a subnet associated with a different table keeps using NAT. That silent asymmetry is the usual reason a team reports an endpoint that "does not work" while the bill says otherwise.

An interface endpoint is an interface in your subnet. It takes a security group, receives addresses in each selected zone, and is billed per hour and per gigabyte. The endpoint's group must allow 443 from the client, and the client's egress must permit the endpoint. Reachability now has two owners, which is why both belong in one review.

Private DNS is a VPC setting and an endpoint setting. The VPC needs DNS resolution and DNS hostnames enabled, and the endpoint needs private DNS turned on. Then the public service name resolves to the endpoint's private addresses inside the VPC. Without both, the SDK receives public addresses and the packet takes the NAT path.

Gateway endpoints deliberately break the DNS assumption. They do not use private DNS, because the prefix-list route is what redirects the traffic. The name still resolves publicly and the packet still leaves through the endpoint. A reviewer looking for a private record will conclude the endpoint is broken when it is behaving exactly as designed.

An endpoint policy filters; it never grants. It is evaluated in addition to IAM, never instead of it. A policy that allows one bucket does not give a role permission to read it, and a role with broad S3 access is still refused by an endpoint policy that excludes the bucket. Both must allow.

Write the policy with a principal and a resource. A working statement allows s3:GetObject on the bucket ARN and adds a condition that aws:PrincipalArn equals the workload role. Leaving the default wildcard policy in place builds a private path with public authorization breadth, which is the most expensive kind of half-finished design.

Close the other side with a bucket policy. The endpoint policy governs who may use the endpoint; a bucket policy condition on aws:SourceVpce governs which endpoint may reach the bucket. Two conditions in two directions describe one intended path, and either one alone leaves a gap.

DNS is the switch that decides whether policy applies at all. If a subnet lacks the endpoint route, or a workload resolves publicly, traffic leaves through NAT and never meets the endpoint policy. The bucket policy is then the only control left. "We have an endpoint" is a reachability statement, not a security statement.

Put the endpoint in every zone the clients use. An interface endpoint enabled in one zone forces clients elsewhere to cross a zone boundary, adding latency and sometimes transfer cost. Drive the subnet list from the same map that created the subnets, so a new zone cannot be half-wired.

Association style matters here too. Endpoint route tables can be set on the endpoint or bound through separate association resources. Pick one. Mixing them recreates the ownership problem from the previous section at a different address, with the same oscillating plan.

PathReachabilityAuthorization and gateName resolutionCost shape
Internet gatewayPublic route to the gateway plus a public addressSecurity group, ACL and IAM at the servicePublic DNSNo gateway fee; public address charge
NAT gatewayPrivate route to a gateway in a public subnetSecurity group, ACL and IAM at the servicePublic DNSHourly per gateway plus per GB
Gateway endpointPrefix-list route on the subnet's tableEndpoint policy plus IAM, optionally a bucket conditionPublic DNS, redirected by the routeNo endpoint fee
Interface endpointInterface in selected subnets, group allows 443Endpoint policy plus IAM, plus the endpoint groupPrivate DNS when enabledHourly per zone plus per GB

Table 1 separates the four exits by what each one can and cannot decide. Only the interface endpoint changes the name the workload resolves; only the gateway endpoint changes reachability with no address in the subnet. The cost column is the reason a design that is correct can still be rejected in review.

Figure 4 shows the same call before and after the endpoint. On the left the application resolves a public address, leaves through NAT and never touches an endpoint policy. On the right private DNS returns the endpoint's address, the endpoint policy decides, and a principal outside the policy is refused before S3 sees the request.

The same bucket reached over NAT and over an interface endpoint with private DNS On the left an application resolves a public address, sends traffic through a NAT gateway and reaches S3 without an endpoint policy in the path. On the right private DNS returns the endpoint address, an endpoint policy checks the principal and the bucket, and a principal outside the policy receives an access denied response. Same bucket, same role, two different paths BEFORE · NAT PATH App interface private subnet NAT gateway elastic IP S3 public IP DNS answer: a public address Endpoint policy: not in the path Bill: gateway hours plus per GB The packet leaves the VPC so no endpoint policy is consulted, and a bucket condition on the endpoint is never satisfied. AFTER · INTERFACE ENDPOINT App interface private subnet Endpoint policy principal and bucket IAM still required S3 endpoint ENI DNS answer: the endpoint address Private DNS resolves to the endpoint Bill: endpoint hours plus per GB Denied principal 403 AccessDenied, no copy no matching principal Private DNS decides whether the endpoint policy is consulted at all. A public answer sends the packet to NAT, where the endpoint policy cannot see it.

Read Figure 4 from the DNS answer, not from the bucket. The left path can still succeed for an authorized role, which is why the bypass survives review: nothing is broken, and nothing is governed. The right path fails the unauthorized principal at the endpoint, before the request reaches S3, and leaves the allowed call untouched.

A 403 from S3 is a success for the network. It means the name resolved, the path existed, the endpoint policy evaluated and the decision was no. A timeout at the same moment means the test never reached the policy. Learning to tell those two apart shortens more investigations than any single configuration change.

Test One Allowed Path and One Denied Path

Test from the subnet that will run the workload. A laptop test proves your office network, not the VPC. Use a session on an instance in the private subnet, or a one-off task launched into the same subnets with the same role. The test is only meaningful when the client, the route table and the security group are the ones that will carry production traffic.

Start with the name, because it reveals the path. Resolve the service name inside the VPC and check whether the answer sits in the endpoint's address range or in a public range. A private answer means private DNS is working; a public answer means the call will take NAT no matter what the policy says. This single check separates most endpoint failures into two families.

Then prove the allowed call. Use the workload's own role, request an object in the permitted bucket, and expect a response. Confirm in the flow logs that the traffic went to the endpoint interface rather than to the NAT gateway. A successful read over the wrong path is not a pass; it is the bypass in production clothing.

Then prove the denied principal is denied for the right reason. A role outside the endpoint policy should receive an access-denied response, not a hang. The distinction matters: a refusal proves the path and the policy both worked, while a timeout proves only that something is missing. Record the error text as evidence, not the screenshot of a failed command.

Add a network-level denial so the test is not only about IAM. From a client outside the endpoint's security group, a request to the endpoint should time out at 443. That is the one case where a timeout is the expected result, and it proves that the group is doing work the policy cannot do.

Try the bypass on purpose. From a subnet without the endpoint route, the same allowed role may still succeed through NAT. That result is not a pass; it is the gap the design was meant to close. If the organization requires that no S3 traffic leaves the VPC, the route table association, not the policy, is the control that enforces it.

Clean up in the reverse order of creation, and look for the billable leftovers. NAT gateways, elastic IPs, interface endpoints and their interfaces all survive a partial destroy and all cost money. An unattached address or an available NAT gateway is the usual residue. Check the state list before the console, because the console shows the account while the state shows the owner.

Drift is the last test and the most honest. Change one ingress rule in the console, run a plan, and confirm the diff appears. A clean plan means the group is not owned by the configuration you think owns it. That is the same failure that produces a rule nobody can remove, seen from the other side.

Lab

Test One Allowed Path and One Denied Path

Status: design-only. Use a lab account, a disposable VPC and placeholder ranges. The lab needs one private subnet with an interface endpoint, one public subnet with a NAT gateway, one S3 bucket, and two roles: the workload role named in the endpoint policy and an outsider role that is not.

Prerequisites. Terraform CLI 1.17.1, provider 6.72.0, a VPC with DNS resolution and DNS hostnames enabled, an interface endpoint with private DNS on, an endpoint policy that allows the workload role and one bucket, and a subnet whose table has no S3 endpoint route for the bypass check.

Steps. 1. Apply the stack and confirm the endpoint reports available with an interface in the expected zone. 2. From the private subnet, resolve the S3 name and record whether the answer is private or public. 3. As the workload role, read one object from the allowed bucket and confirm success. 4. As the outsider role, repeat the read and record the exact error rather than the exit code. 5. From a client outside the endpoint security group, attempt the same read on 443. 6. Launch the test instance in the subnet without the endpoint route and repeat step 3. 7. Change one ingress rule in the console, run a plan, then destroy the stack and list what remains.

CheckActionPass conditionFailure signal
ResolutionResolve the name inside the VPCAnswer in the endpoint rangePublic answer, so the call will use NAT
Allowed callRead as the workload roleObject returned, flow log shows the endpointTimeout, which points at group or route
Denied callRead as the outsider roleAccess denied, no object returnedSuccess, which means the policy is too broad
Group denialRead from outside the endpoint groupTimeout on 443Success, which means the client is inside the group
BypassRepeat the allowed call without the routeTraffic leaves through NATNo egress at all, which hides the bypass
OwnershipEdit a rule in the console, planThe diff appearsClean plan, so another state owns the group

Expected observation. The workload role reads the object over the endpoint with a private DNS answer and a flow-log entry to the endpoint interface. The outsider role is refused by the endpoint policy with no request reaching the bucket. The client outside the group times out. The subnet without the route still succeeds through NAT, which is the finding, not the pass. The console edit appears as a plan diff.

Failure check. The lab fails if the outsider reads the object, if the allowed role times out, if the private name resolves publicly while private DNS is enabled, or if the console edit produces no diff. It also fails if the only evidence is a terminal transcript; the resolution answer, the flow-log entry and the error text are the evidence.

Cost and cleanup. One interface endpoint per zone, one NAT gateway and its address, one small instance and one bucket. Destroy the endpoint and the NAT gateway explicitly before the VPC, release the address, and confirm no interface remains in the subnets. The bucket must be emptied before it can be destroyed.

Evidence to keep. The resolved address and the resolver used, one allow and one deny response, the flow-log records for both, the plan diff after the console edit, and the destroy output showing no remaining network interfaces or addresses.

Close with the three questions the configuration must answer. Which subnets are public and which route makes them so, which paths reach AWS services and which policy governs each, and which state owns every route and rule. A VPC that can answer all three is understandable; one that cannot will keep producing outages that look like application bugs.

Next in the Series

In EC2 Service Delivery: Launch Templates, Auto Scaling and ALB Health, we'll explore Release compute capacity through immutable inputs, observable readiness and controlled replacement.