Volume 2 · Chapter 4 — AWS Networking Deep Dive (VPC)
VPC Endpoints and PrivateLink
4.1 Introduction
By default, when a resource in your VPC calls an AWS service like S3 or a partner’s API, that traffic goes out to a public endpoint over the internet - even though both ends are within AWS. For a bank handling sensitive data, sending traffic over the public internet, and needing a NAT gateway and internet route just to reach an AWS service, is undesirable. VPC endpoints and PrivateLink solve this by letting your VPC reach AWS services and third-party services over private connections that never traverse the internet. This is a core security-and-architecture topic because it’s how you keep sensitive traffic entirely private.
4.2 The Problem VPC Endpoints Solve
Consider a private application server that needs to read and write objects in S3. Without an endpoint, its request to S3 must leave the VPC through a NAT gateway and internet gateway, travel to S3’s public endpoint, and return - meaning the traffic touches the public internet, depends on internet routing, and requires those gateways. That’s operationally heavier and, for sensitive data, a security concern. A VPC endpoint removes the internet from the path entirely: it provides a private route from your VPC directly to the AWS service over AWS’s internal network, so the traffic never leaves AWS and never touches the public internet.
4.3 Gateway vs Interface Endpoints
There are two kinds of VPC endpoint. A gateway endpoint is used for S3 and DynamoDB specifically: you add a route to your route table that directs traffic destined for that service through the gateway endpoint, keeping it private, and it’s free. An interface endpoint is used for most other AWS services (and for PrivateLink): it provisions a network interface with a private IP inside your subnet, and traffic to the service goes to that private IP and stays on AWS’s network; interface endpoints carry an hourly and data-processing cost. The practical rule to remember is: S3 and DynamoDB use gateway endpoints (free, route-table based); everything else uses interface endpoints (private IP in your subnet, priced).
flowchart LR App[Private app server] -->|no endpoint| NAT[NAT + IGW] -->|public internet| S3pub[(S3 public endpoint)] App -->|gateway endpoint\nroute table entry| S3priv[(S3 - private, stays on AWS)] App -->|interface endpoint\nprivate IP in subnet| Svc[(Other AWS service / PrivateLink)]
4.4 AWS PrivateLink
PrivateLink extends the same idea beyond AWS’s own services to expose a service privately between VPCs - including to and from third parties. It lets a service provider publish an endpoint service that consumers reach through an interface endpoint (a private IP) in their own VPC, so the two parties communicate over private connectivity without VPC peering, without exposing the service to the internet, and without the networks’ IP ranges needing to be routable to each other. For banks this is how they consume a fintech partner’s API, or expose their own service to a partner, entirely privately - the partner’s service appears as a private IP inside the bank’s VPC, and no traffic ever traverses the public internet.
4.5 Banking Production Scenario
A bank’s private application servers need S3 (for documents), DynamoDB (for session data), Secrets Manager (for credentials), and a fintech partner’s fraud-scoring API. It creates gateway endpoints for S3 and DynamoDB, adding route-table entries so that traffic stays on AWS’s network at no cost. It creates interface endpoints for Secrets Manager and other AWS services, each appearing as a private IP in the application subnets. And it consumes the partner’s fraud API through a PrivateLink interface endpoint, so the partner’s service is reachable as a private IP inside the bank’s VPC with no internet exposure on either side. The result: sensitive traffic to AWS services and partners never touches the public internet, and the bank can even remove internet egress for tiers that only need private AWS and partner connectivity.
4.6 Troubleshooting: Endpoint Issues
Endpoint problems usually stem from three things. For gateway endpoints (S3/DynamoDB), the most common mistake is forgetting to add the route-table entry, so traffic still tries to go via the internet - the fix is ensuring the relevant route tables point the service traffic through the gateway endpoint. For interface endpoints, connectivity failures often come from the endpoint’s security group not allowing traffic from the calling resources, or from private DNS not being enabled so the service’s normal hostname doesn’t resolve to the private IP - the fixes are to allow the traffic and enable private DNS. Endpoint policies that are too restrictive can also block legitimate calls. The general diagnostic is to confirm the endpoint exists for the right service, the route or DNS directs traffic to it, and the security group and endpoint policy permit the call.
What problem do VPC endpoints solve, and what's the difference between gateway and interface endpoints?
VPC endpoints solve the problem that, by default, when a resource in your VPC calls an AWS service like S3, that traffic goes out to the service’s public endpoint over the internet - even though both ends are within AWS. For a private application server calling S3 without an endpoint, the request has to leave the VPC through a NAT gateway and internet gateway, travel across the public internet to S3’s public endpoint, and return. That means sensitive traffic touches the public internet, depends on internet routing, and requires those gateways just to reach an AWS service - which is operationally heavier and, for a bank, a security concern. A VPC endpoint removes the internet from the path entirely by providing a private route from your VPC directly to the AWS service over AWS’s internal network, so the traffic never leaves AWS and never touches the public internet. There are two types. A gateway endpoint is used specifically for S3 and DynamoDB: you add an entry to your route table directing traffic for that service through the gateway endpoint, it keeps the traffic private, and it’s free. An interface endpoint is used for most other AWS services, and for PrivateLink: it provisions an elastic network interface with a private IP address inside your subnet, and traffic to the service goes to that private IP and stays on AWS’s network; interface endpoints carry an hourly charge plus data-processing cost. The rule I remember is: S3 and DynamoDB use gateway endpoints (free, route-table based), and everything else uses interface endpoints (a private IP in your subnet, priced). The benefits of using endpoints are that sensitive traffic to AWS services stays entirely private and never traverses the internet, you can reduce or remove reliance on NAT gateways and internet egress for tiers that only need AWS connectivity, and you get tighter security because you can even attach policies to the endpoint controlling what can be accessed through it. So endpoints are how you keep your VPC’s traffic to AWS services private, with gateway endpoints for S3/DynamoDB and interface endpoints for the rest.
What is AWS PrivateLink and when would a bank use it?
AWS PrivateLink is a way to expose and consume a service privately between VPCs - including across organizations - so that two parties communicate over private connectivity without the traffic ever traversing the public internet. It builds on the interface-endpoint concept: a service provider publishes an endpoint service, and a consumer reaches it through an interface endpoint - a network interface with a private IP - inside the consumer’s own VPC. From the consumer’s perspective, the provider’s service simply appears as a private IP address within their VPC, and they call it as if it were local, while all traffic stays on AWS’s private network. Crucially, this works without VPC peering, without exposing the service to the internet, and without the two networks’ IP ranges needing to be routable to each other or free of overlap - PrivateLink connects a specific service, not entire networks, which is both simpler and more secure than peering when you only need to share one service. A bank uses PrivateLink in two directions. As a consumer, it’s how the bank privately consumes a third-party service - say a fintech partner’s fraud-scoring or payments API - so the partner’s service is reachable as a private IP inside the bank’s VPC with no internet exposure on either side, keeping sensitive request data off the public internet and avoiding the need to open internet egress. As a provider, it’s how the bank can expose one of its own services to a partner privately, publishing an endpoint service that the partner reaches through an interface endpoint in their VPC, again without exposing the service publicly or connecting the whole networks. The reasons a bank favours this are security and simplicity: sensitive inter-company traffic never touches the internet, only the single intended service is shared rather than opening broad network connectivity, and there’s no dependency on non-overlapping IP ranges the way peering requires. So PrivateLink is private, service-specific connectivity between VPCs and organizations, and a bank uses it to consume partner APIs and expose its own services with the traffic staying entirely private.
Chapter Revision Notes
- By default, VPC traffic to AWS services goes over the public internet; endpoints make that path private (stays on AWS’s network).
- Gateway endpoints: for S3 and DynamoDB only, route-table based, free.
- Interface endpoints: for most other services and PrivateLink, a private IP in your subnet, priced hourly + per data.
- PrivateLink privately exposes/consumes a single service between VPCs or organizations - no peering, no internet, no IP-range overlap concern.
- Banks use endpoints and PrivateLink to keep sensitive traffic to AWS services and partners entirely off the public internet.