Choosing and configuring an AWS VPC endpoint
An AWS VPC endpoint connects workloads in a VPC to supported AWS services. For S3 or DynamoDB used only from the VPC, a **gateway endpoint** added to route tables is often the first option. For many other services supported by PrivateLink, or access from on-premises or peered networks, consider an **interface endpoint**. Creating an endpoint does not automatically configure IAM permissions, service policies, DNS, or network rules. ([AWS: VPC endpoint types](https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints.html), [AWS: Gateway endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/gateway-endpoints.html))
Choosing and configuring an AWS VPC endpoint
An AWS VPC endpoint connects workloads in a VPC to supported AWS services. For S3 or DynamoDB used only from the VPC, a gateway endpoint added to route tables is often the first option. For many other services supported by PrivateLink, or access from on-premises or peered networks, consider an interface endpoint. Creating an endpoint does not automatically configure IAM permissions, service policies, DNS, or network rules. (AWS: VPC endpoint types, AWS: Gateway endpoints)
This AWS-specific guide focuses on selecting and configuring endpoints to AWS managed services. It explains the routing difference, a private-subnet S3 example, and how to check policy and network layers. A separate article covers AWS PrivateLink more broadly; this guide does not repeat the earlier multi-cloud endpoint overview.
What path does a VPC endpoint provide?
An application can often keep using the service's normal DNS name, while the network path depends on endpoint type. Gateway endpoints are available for S3 and DynamoDB. They add an AWS-managed service prefix-list route to selected VPC route tables. Traffic from subnets using those route tables reaches the service without an internet gateway or NAT device. Gateway endpoints do not use AWS PrivateLink. (AWS: Gateway endpoints)
An interface endpoint creates a requester-managed network interface (ENI) with a private IP in each selected subnet for supported services. With private DNS enabled, applications can usually continue using the standard AWS service name, which resolves to the endpoint's private IPs. The endpoint ENI security group and subnet network ACL must permit the traffic. (AWS: Create an interface endpoint, AWS: Interface endpoints and DNS)
How do I choose gateway or interface?
Start with the service and where its clients run. S3 and DynamoDB support both types. A gateway endpoint usually fits resources in the VPC that reach the service through that Region's route tables. An interface endpoint may be needed for private access from on-premises networks or peered VPCs in another Region. Availability depends on the service and Region, so check AWS's current support list. (AWS: S3 endpoint types, AWS PrivateLink supported services)
| Criterion | Gateway endpoint | Interface endpoint |
|---|---|---|
| Typical services | S3, DynamoDB | Many services that support PrivateLink |
| VPC path | Service prefix-list route in associated route tables | Private ENIs in selected subnets, controlled by security groups |
| Reach | Service traffic from VPC subnets using those route tables | VPC and, depending on network/DNS configuration, other connected networks |
| DNS | Check service and Region-specific routing | Private DNS can resolve the standard service name to private IPs |
| Watch for | Other-Region traffic does not use the same-Region gateway route | ENI security groups, DNS, service support and usage charges |
Gateway routing applies only to associated route tables. Subnets using other route tables do not use that endpoint. The most specific route wins, so traffic to another Region or an explicit service IP range may take a different path. Choose route tables with this behavior in mind. (AWS: Gateway endpoint routing)
How do I set up an S3 gateway endpoint for a private subnet?
Suppose a batch job in a private subnet reads and writes objects in an S3 bucket in the same Region. If only VPC workloads need the connection, a gateway endpoint can provide an S3 route without adding general internet egress. In the console, the main steps are:
In the VPC console, open **Endpoints → Create endpoint**.
Choose **AWS services**, then select the S3 gateway service for the Region, typically `com.amazonaws.<region>.s3` for general purpose buckets.
Choose the VPC and the route tables used by the private subnets. AWS adds a route with the service prefix list as its destination.
Review the endpoint policy. The default policy allows full access through the endpoint; if supported, use a custom policy limited to required principals, buckets and actions.
Verify the route exists and that instance security groups and subnet network ACLs allow HTTPS traffic to S3. ([AWS: Create an S3 gateway endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints-s3.html))
An endpoint policy is an additional control; it does not replace IAM identity policies or S3 bucket policies. Access must be allowed by the applicable policy evaluation, and an explicit deny still blocks it. For S3 requests through a VPC endpoint, some bucket-policy conditions may need aws:VpcSourceIp instead of aws:SourceIp; check the AWS guidance for the exact condition. (AWS: Endpoint policies, AWS: S3 gateway security considerations)
When should I configure an interface endpoint?
Consider an interface endpoint when the service supports PrivateLink and clients outside the VPC, such as an approved on-premises network, also need private access, or when the service has no gateway endpoint. In the VPC console, open Endpoints → Create endpoint, select the AWS service and VPC, choose subnets in the needed Availability Zones, and attach a security group that allows client HTTPS traffic. For private DNS, enable the VPC's DNS hostnames and DNS resolution and review the endpoint DNS setting. Interface endpoints can incur hourly and data-processing charges, so consider their scope and cost. (AWS: Create an interface endpoint)
After creation, separately verify that application DNS resolves to private IPs, the security group allows the destination port, and the service supports the selected Region and endpoint type. Interface endpoints may not respond to ICMP ping; check the actual TCP/TLS service port and API request instead. (AWS: Interface endpoint prerequisites and ICMP)
What should I check when connectivity or API calls fail?
**DNS returns an unexpected address:** Check private DNS and VPC DNS attributes for an interface endpoint; for a gateway endpoint, verify Region and service DNS. With custom DNS, confirm that the service name resolves as intended.
**Connection times out:** For a gateway endpoint, check the service prefix-list route in the route table used by the subnet, plus security groups and network ACLs. For an interface endpoint, check its private ENI IP, inbound security-group rules and subnet ACL.
**`AccessDenied`:** Review the caller's IAM policy, S3 bucket policy, endpoint policy and any explicit organization-level deny separately. Changing only the endpoint policy will not remove a denial from another policy layer.
**Only some instances fail:** Confirm the endpoint is associated with the route tables used by those instances' subnets. A gateway endpoint does not automatically extend to networks outside the VPC.
Official documentation
[AWS VPC endpoint types](https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints.html)
[AWS Gateway endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/gateway-endpoints.html)
[AWS S3 gateway endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints-s3.html)
[AWS Create an interface endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/create-interface-endpoint.html)
[AWS Interface endpoint configuration and DNS](https://docs.aws.amazon.com/vpc/latest/privatelink/interface-endpoints.html)
[AWS VPC endpoint policies](https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints-access.html)
[AWS PrivateLink supported services](https://docs.aws.amazon.com/vpc/latest/privatelink/aws-services-privatelink-support.html)