Topic lessonTopic: VPC: address and connectivity design
Choose a VPC endpoint: gateway, interface and NAT compared
A VPC endpoint provides VPC-side connectivity to a supported service or resource; it is not one universal connection method. Compare gateway and interface endpoints for AWS-service access, focusing on route tables, DNS, permissions and cost. Creating an endpoint does not provide access to arbitrary websites or grant permission to perform service operations.
Choose a type for the service, source and address family, then separate routing/DNS problems from traffic controls and service authorization.
Know subnets, route tables, DNS resolution and IAM permissions. An ENI is a network interface in a VPC. Examples focus on same-Region AWS API access; no endpoint is created or contacted.
First distinguish route-based gateway access from interface ENIs
Gateway endpoint
Uses a route matching an AWS-managed service prefix list.
- VPC application
- Gateway endpoint
- S3 / DynamoDB
Associate the appropriate subnet route tables with the service route; this does not use an interface endpoint’s ENI address as the destination.
DNS and routingMatch the service destination to its specific route. Resolution to public service IPs does not by itself imply an IGW path.
Interface endpoint
Connects to the IP of a service-specific endpoint ENI.
- VPC application
- Endpoint ENI
- Supported service
An ENI is created in a selected subnet; review its SG and the service’s supported configuration. This uses AWS PrivateLink.
DNS and routingReview endpoint-specific names or private DNS. Resolving an ENI IP and being permitted to reach it are separate conditions.
Arrows show the logical request path to the service. DNS resolution is not an inline traffic-forwarding hop.
S3 and DynamoDB support both gateway and interface endpoints. Gateway endpoints do not use AWS PrivateLink. Avoid treating every endpoint as PrivateLink or assuming S3 offers only gateway access; select the type for the source and service requirements.
Choose using the service, source and route
| Need | Candidate | First checks |
|---|---|---|
| Same-Region S3 / DynamoDB from this VPC | Gateway endpoint | The service prefix list and associated route tables |
| An AWS API supported by PrivateLink | Interface endpoint | Service name, supported AZs, ENIs, DNS, SGs and permissions |
| Private S3 access from a corporate network | An S3 interface-endpoint design | Connectivity and DNS; gateway access cannot simply be extended outside the VPC |
| General external APIs or distribution sites | Suitable NAT or another approved path | An endpoint service may not exist for that destination |
| Routing through virtual network appliances | Gateway Load Balancer endpoint | A distinct purpose: steering traffic through appliances |
| Shared resources or a service network | Resource / service-network endpoints and related options | Their own PrivateLink/VPC Lattice requirements, not generic AWS API interface settings |
Gateway example: an S3 route can coexist with a NAT default route
| Destination | Target | Use in this example |
|---|---|---|
| VPC CIDR | local | Matching traffic inside the VPC |
| AWS-managed S3 prefix list (pl-s3) | Gateway endpoint (vpce-s3) | Matching same-Region S3 destinations |
| 0.0.0.0/0 | NAT gateway (nat-egress) | Other IPv4 egress without a more-specific matching route |
The service prefix-list route is more specific than a normal 0.0.0.0/0 default route. Still check more-specific routes and destinations in other Regions. A working gateway endpoint in one subnet does not prove coverage of every subnet. Verify which route tables are associated with the endpoint and which subnets use them.
Choose an option to see the result and explanation.
Interface access: check ENIs, DNS and SGs separately
For an interface endpoint, select one subnet per chosen AZ; the endpoint creates an ENI there. Private DNS requires suitable VPC DNS hostnames and resolution settings. It can change how a service’s usual name resolves, but does not make every name or source follow the same path automatically.
For an HTTPS AWS API example, review client egress, inbound rules on the endpoint ENI’s SG, relevant NACLs and service authorization. TCP 443 belongs to this HTTPS example; it is not a universal endpoint-service port. Treat DNS resolution, transport connectivity and API success as separate observations.
Verify IPv4, IPv6 and dual-stack compatibility across the service, endpoint type, subnets and DNS record settings. Do not assume gateway endpoints are always IPv4-only or every interface endpoint supports IPv6.
Compare costs and change effects using the same scope
| Type or consideration | Costs and conditions to review |
|---|---|
| Gateway endpoint | No additional endpoint hourly or processing fee; service charges remain separate |
| Interface endpoint | Configured AZ-hours, processed GB and applicable transfer; check service-included pricing exceptions |
| Multiple services | Compare endpoint count × AZs × period, processing and actual DNS behavior |
| Coexisting NAT | Separate diverted traffic from the NAT hours and destinations that remain |
| Changes | Review connection disruption/reconnection from route or DNS changes and effects on policy conditions |
- Record source, service, Region, address family and required API operation.
- Choose the type. Check route associations/prefix lists for gateway access or ENIs/AZs/DNS for interface access.
- Review relevant SGs, NACLs, endpoint policies and IAM/resource policies as distinct controls.
- Validate DNS, connectivity and API responses separately; an HTTP denial is not automatically a missing route.
- Review other traffic, costs, disruption and recovery before any authorized real-world change. This lesson performs none.
Check, then explain in your own words
- Explain how gateway/interface routes, DNS and ENIs differ.
- List checks before removing NAT from an S3-plus-external-API architecture.
- Explain why AccessDenied can still occur through an endpoint.
Check your understanding: Does adding an endpoint solve every connectivity and permission problem?
No. Separate supported destinations and type, routing/DNS, traffic controls and service authorization.
Types have different prerequisites and billing. Do not remove NAT/IGW paths needed by other traffic or broaden exposure simply to avoid an authorization denial.
Sources and conditions checked
The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.
- Gateway endpointsChecked:
Scope and conditionsS3/DynamoDB gateway routes and prefix-list specificity, supported IP/DNS modes and controls; not PrivateLink; no additional gateway endpoint charge.
Used in this lessonFirst distinguish route-based gateway access from interface ENIs Choose using the service, source and route Gateway example: an S3 route can coexist with a NAT default route Interface access: check ENIs, DNS and SGs separately Compare costs and change effects using the same scope
Scope and conditionsService-supported interface endpoint ENIs, subnet/AZ choice, private DNS prerequisites, SGs and hourly/processing charges.
Used in this lessonFirst distinguish route-based gateway access from interface ENIs Choose using the service, source and route Interface access: check ENIs, DNS and SGs separately
- Configure an interface endpointChecked:
Scope and conditionsOne selected subnet per AZ, endpoint ENIs, SG and private-DNS configuration.
Used in this lessonFirst distinguish route-based gateway access from interface ENIs Interface access: check ENIs, DNS and SGs separately
- AWS PrivateLink conceptsChecked:
Scope and conditionsInterface, Gateway Load Balancer, resource and service-network endpoints serve distinct purposes; policies are not universal service authorization.
Used in this lessonChoose using the service, source and route
- Gateway endpoints for Amazon S3Checked:
Scope and conditionsSame-Region routes, no extension through peering/VPN/TGW/Direct Connect, service permissions and S3 private-DNS inbound-Resolver-only split behavior.
Used in this lessonChoose using the service, source and route Interface access: check ENIs, DNS and SGs separately Compare costs and change effects using the same scope
- NAT gatewaysChecked:
Scope and conditionsInitiated outbound connections; public/private NAT connectivity, IPv4 translation and IPv6 DNS64/NAT64 boundaries. Zonal placement is distinguished from regional mode.
Used in this lessonChoose using the service, source and route Gateway example: an S3 route can coexist with a NAT default route
Scope and conditionsEndpoint policy support is service-specific; endpoint policies do not replace identity or resource policies. Default full endpoint access is not universal service authorization.
Used in this lessonInterface access: check ENIs, DNS and SGs separately Authorization: endpoint policies do not replace service permissions
- AWS PrivateLink pricingChecked:
Scope and conditionsInterface endpoint per-AZ hours and processed data, service-specific included pricing and cross-Region transfer considerations; not a claim that all endpoint types share one price.
Used in this lessonCompare costs and change effects using the same scope
- AWS PrivateLink for Amazon S3Checked:
Scope and conditionsGateway routes use S3 public service IPs; interface ENIs use VPC private IPs. DNS mode and source connectivity affect the path; supported IP/DNS types are not universally IPv4-only.
Used in this lessonLesson overview and review