INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

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.

What you will learn

Choose a type for the service, source and address family, then separate routing/DNS problems from traffic controls and service authorization.

Prerequisite

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 and interface endpoints require different client-side checks

Gateway endpoint

Uses a route matching an AWS-managed service prefix list.

  1. VPC application
  2. Gateway endpoint
  3. 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.

  1. VPC application
  2. Endpoint ENI
  3. 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

Examples of choices; check each type’s service, Region and address-family support
NeedCandidateFirst checks
Same-Region S3 / DynamoDB from this VPCGateway endpointThe service prefix list and associated route tables
An AWS API supported by PrivateLinkInterface endpointService name, supported AZs, ENIs, DNS, SGs and permissions
Private S3 access from a corporate networkAn S3 interface-endpoint designConnectivity and DNS; gateway access cannot simply be extended outside the VPC
General external APIs or distribution sitesSuitable NAT or another approved pathAn endpoint service may not exist for that destination
Routing through virtual network appliancesGateway Load Balancer endpointA distinct purpose: steering traffic through appliances
Shared resources or a service networkResource / service-network endpoints and related optionsTheir own PrivateLink/VPC Lattice requirements, not generic AWS API interface settings

Gateway example: an S3 route can coexist with a NAT default route

Synthetic same-Region S3 routes; pl-s3, vpce-s3 and nat-egress are explanatory labels
DestinationTargetUse in this example
VPC CIDRlocalMatching traffic inside the VPC
AWS-managed S3 prefix list (pl-s3)Gateway endpoint (vpce-s3)Matching same-Region S3 destinations
0.0.0.0/0NAT 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.

An application uses S3 and an unrelated external API. If its S3 gateway endpoint works, can NAT be removed without affecting either destination?
Read the answer and reason

Answer: No: the external API still needs its own valid path · A gateway endpoint routes supported service destinations. Removing NAT without inventorying other traffic can break required external access.

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.

Authorization: endpoint policies do not replace service permissions

An endpoint policy controls supported service access through an endpoint. It does not override or replace IAM identity policies or resource policies such as S3 bucket policies. Some services do not support endpoint policies. Keep connectivity preparation separate from deciding who may perform an operation.

Choose an option to see the result and explanation.

DNS and connectivity work and the endpoint policy permits access, but S3 GetObject returns AccessDenied. What is the appropriate next step?
Read the answer and reason

Answer: Check the requester, object and IAM/resource permissions · Endpoint permission is not the complete authorization decision. Investigate the particular request and applicable policies rather than broadly relaxing traffic controls or bucket exposure.

Compare costs and change effects using the same scope

Separate no additional endpoint charge from a free overall architecture
Type or considerationCosts and conditions to review
Gateway endpointNo additional endpoint hourly or processing fee; service charges remain separate
Interface endpointConfigured AZ-hours, processed GB and applicable transfer; check service-included pricing exceptions
Multiple servicesCompare endpoint count × AZs × period, processing and actual DNS behavior
Coexisting NATSeparate diverted traffic from the NAT hours and destinations that remain
ChangesReview connection disruption/reconnection from route or DNS changes and effects on policy conditions
  1. Record source, service, Region, address family and required API operation.
  2. Choose the type. Check route associations/prefix lists for gateway access or ENIs/AZs/DNS for interface access.
  3. Review relevant SGs, NACLs, endpoint policies and IAM/resource policies as distinct controls.
  4. Validate DNS, connectivity and API responses separately; an HTTP denial is not automatically a missing route.
  5. Review other traffic, costs, disruption and recovery before any authorized real-world change. This lesson performs none.

Check, then explain in your own words

  1. Explain how gateway/interface routes, DNS and ENIs differ.
  2. List checks before removing NAT from an S3-plus-external-API architecture.
  3. 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.