AWS in 1 Min · Episode 48

VPC endpoints: gateway vs interface

Gateway vs interface. Watch the one-minute video, then read the details.

David Gomez1:18 video · 3 min read

"Private subnets need a NAT gateway to reach S3." They don't. A VPC endpoint is a private door from your VPC straight to an AWS service, so servers with no route to the internet can still read a bucket, write to a table or call a model. There are two main kinds, gateway and interface, and they work so differently that picking the wrong one costs you either money or hours of debugging.

Gateway endpoints: a route, not a device

A gateway endpoint is an entry in your route table. When you create one, you pick the route tables to associate, and AWS adds a route whose destination is the service's prefix list (the service's address ranges in that Region) and whose target is the endpoint.

  • They exist for only two services: Amazon S3 and DynamoDB.
  • There is no additional charge for using them.
  • Your instances still call the service's normal public endpoint name; the route simply sends that traffic through the gateway instead of an internet gateway or NAT device.
  • Only subnets whose route table is associated with the endpoint use it. A forgotten route table is the classic reason "the endpoint doesn't work".

One limit to remember: a gateway endpoint serves traffic that starts inside that VPC. It is not a way for your office network to reach S3 over a VPN or Direct Connect.

Interface endpoints: a private address in your subnet

An interface endpoint is powered by AWS PrivateLink. For each subnet you select, AWS creates an endpoint network interface with a private IP address from that subnet's range. Traffic to the service goes to that address.

  • They cover most AWS services, plus services other companies publish through PrivateLink.
  • With private DNS enabled, the service's usual name resolves to the private address, so SDK calls need no code changes.
  • Each endpoint has a security group. If it doesn't allow inbound HTTPS from your resources, calls time out.
  • You pay per hour for each endpoint in each Availability Zone, plus a data processing charge per gigabyte. Check the PrivateLink pricing page for your Region.

Because the endpoint is a real address inside your VPC, it can also be reached from on-premises networks connected by VPN or Direct Connect.

Which one to pick

  • S3 or DynamoDB, from inside the VPC: start with the gateway endpoint. It is free and takes minutes.
  • S3 or DynamoDB from on premises, or from another VPC: use an interface endpoint. Both services support both types.
  • Almost everything else (Secrets Manager, ECR, CloudWatch, SQS, Bedrock and many more): interface endpoint.

A common mistake is creating interface endpoints for a dozen services in every VPC "to be safe" and then being surprised by the bill. Add them for the services your private workloads really call. Another is assuming endpoints replace NAT completely: anything that needs the public internet, such as a third-party API or an operating system update mirror, still needs a way out.

Where AI fits

Model calls often carry the most sensitive text a company has: contracts, support tickets, patient notes. Amazon Bedrock supports interface endpoints, including one for the runtime API that invokes models (bedrock-runtime). Create it in the subnets where your application runs, enable private DNS, and the app calls the models without an internet gateway, a NAT device or a public IP address.

A typical private AI stack uses both types at once: a free gateway endpoint for the S3 bucket that holds the documents, and an interface endpoint for Bedrock.

Quick recap

  • Gateway endpoints are free routes in your route table, for S3 and DynamoDB only.
  • Interface endpoints are private IP addresses in your subnets, powered by PrivateLink, billed per hour and per gigabyte, for most services.
  • Bedrock has interface endpoints, so model calls can stay off the public internet.
AWS in 1 Min #48 · 1:18

Need an AWS expert on your team?

I'm David, an AWS expert and fractional cloud consultant. I work alongside your team to run your cloud and infrastructure: architecture, security, cost and day-to-day operations. You get senior AWS experience when you need it, without the cost of a full-time hire.

  • Architecture reviews and a clear plan for what to fix first
  • Security hardening: IAM, networking, audits
  • Lower AWS bills without slowing your team down
  • Hands-on help with AI workloads on AWS