Your checkout service needs an orders API that another team runs in a different AWS account. Both VPCs use 10.0.0.0/16, so peering is off the table: AWS refuses to peer overlapping CIDR blocks. What remains is a public endpoint with IP allowlists, or a renumbering project nobody wants.
AWS PrivateLink publishes a service into your VPC instead of joining two networks. Your app connects to private IPs in its own subnets, and AWS carries the traffic to the provider's load balancer. The same mechanism lets private subnets call AWS APIs without a NAT gateway.
This post covers the endpoint types, interface and gateway endpoints, endpoint services behind a Network Load Balancer, PrivateLink versus peering and Transit Gateway, costs, and a diagram you can copy.
Publishing a service instead of routing a network
A VPC reaches the outside world in three ways: the internet path (an internet gateway, or a NAT gateway that bills every GB), routing (VPC peering or a transit gateway, which join whole networks and need unique address ranges), or PrivateLink. With PrivateLink, the consumer gets network interfaces with private IPs in its own subnets, and no route points to the other VPC. Three consequences drive most design decisions:
- Overlapping CIDRs do not matter: the consumer only talks to addresses in its own VPC.
- Connections go one way: the provider cannot connect back through the endpoint.
- The provider exposes a listener, not a network.
VPC endpoint types
The PrivateLink concepts page lists six endpoint types at the time of writing:
| Endpoint type | Reaches | How traffic gets there | PrivateLink |
|---|---|---|---|
| Gateway | S3 and DynamoDB in the same Region | Route table entry for the service's prefix list | No |
| Interface | AWS services, endpoint services behind an NLB, SaaS | Network interfaces in your subnets, found through DNS | Yes |
| Gateway Load Balancer | Virtual appliances such as firewalls | Route table entries that point to the endpoint | Yes |
| Resource | One shared database, IP address or domain name | Network interfaces, no load balancer; shared with AWS RAM | Yes |
| Service network | A VPC Lattice service network | One endpoint for many services and resources | Yes |
| Tunnel | CIDR ranges shared from another VPC | Traffic you encapsulate in GENEVE | Yes |
Most designs need the first two, plus endpoint services. Fargate tasks in private subnets, for example, pull images through ECR interface endpoints and the image layers from S3 through a gateway endpoint.
How interface endpoints work
You choose one subnet per Availability Zone, and AWS creates an endpoint network interface (ENI) in each, with a private IP that stays fixed for the endpoint's lifetime. A security group on the endpoint decides who may connect, typically TCP 443 from your application's security group.
DNS ties it together:
- The Regional name, such as
vpce-0a1b2c3d4e5f67890-abcd1234.sqs.us-east-1.vpce.amazonaws.com, returns a healthy ENI, alternating between zones. - Zonal names keep a client in its own AZ.
- Private DNS adds a hidden private hosted zone (the VPC needs DNS hostnames and resolution enabled), so
sqs.us-east-1.amazonaws.comresolves to the ENIs and SDK code works unchanged.
On-premises clients resolve these names through an inbound Route 53 Resolver endpoint (how DNS works).
Interface endpoints carry TCP or UDP. The quotas page lists the limits that come up in reviews: 10 Gbps per AZ, scaling automatically to 100 Gbps; an 8,500-byte MTU without Path MTU Discovery; and 50 interface and Gateway Load Balancer endpoints per VPC.
In Terraform, both endpoint kinds are the same resource:
resource "aws_vpc_endpoint" "sqs" {
vpc_id = aws_vpc.consumer.id
service_name = "com.amazonaws.us-east-1.sqs"
vpc_endpoint_type = "Interface"
subnet_ids = [aws_subnet.private_a.id, aws_subnet.private_b.id]
security_group_ids = [aws_security_group.endpoints.id]
private_dns_enabled = true
}
resource "aws_vpc_endpoint" "s3" {
vpc_id = aws_vpc.consumer.id
service_name = "com.amazonaws.us-east-1.s3"
vpc_endpoint_type = "Gateway"
route_table_ids = [aws_route_table.private.id]
}
Gateway endpoints for S3 and DynamoDB
Gateway endpoints do not use PrivateLink. Associating a route table adds a route from the service's managed prefix list (pl-...) to the endpoint. You cannot edit it, and because the longest prefix wins, same-Region S3 traffic takes it instead of the default route.
Details from the S3 gateway endpoint page that cause outages:
- Clients still use public S3 addresses, so security groups must allow outbound 443 to the prefix list, and network ACLs need its CIDR ranges.
- Creating or changing the endpoint drops open TCP connections to S3.
- Only subnets whose route tables you associate can use it. On-premises networks, peered VPCs, site-to-site VPN connections, Direct Connect and transit gateways need an S3 interface endpoint.
Gateway endpoints are free. S3 traffic through a NAT gateway costs $0.045 per GB processed in US East, so 5 TB a month (5,120 GB × $0.045) adds $230.40 that a gateway endpoint removes.
Endpoint policies
An endpoint policy is an IAM resource policy on the endpoint; the default allows everything. A custom policy, up to 20,480 characters, adds a check on top of identity and bucket policies rather than replacing them. Gateway endpoint policies need "Principal": "*" plus an aws:PrincipalArn condition. In bucket policies, aws:SourceVpce pins a bucket to your endpoint; use aws:VpcSourceIp, because aws:SourceIp does not work through endpoints.
Publishing your own service: endpoint services
The provider side, from the endpoint service guide:
- Put a Network Load Balancer in front of the service, in at least two AZs.
- Create the endpoint service from it, named like
com.amazonaws.vpce.us-east-1.vpce-svc-0e123abc123198abc. - Require acceptance, so new connections wait as pending until you accept them.
- Add allowed principals, such as the consumer's account. By default, nobody can connect.
- Optionally add a private DNS name such as
orders.example.com, after proving you own the domain. - Share the service name and AZ IDs such as
use1-az1; AZ names likeus-east-1acan differ between accounts. - The consumer creates an interface endpoint in matching zones, and you accept it.
Targets see the NLB's private IPs, not the consumer's; proxy protocol v2 adds a header with the client address and endpoint ID. An NLB security group must allow the client addresses, or you turn off its inbound rule evaluation for PrivateLink traffic.
Providers can also enable cross-Region access; PrivateLink then handles AZ failover but not Region failover. Since November 2025, select AWS services, including S3 and ECR, work across Regions too.
PrivateLink vs VPC peering vs Transit Gateway
| PrivateLink | VPC peering | Transit Gateway | |
|---|---|---|---|
| Exposes | One service behind an NLB | Both VPCs | Every attached network |
| Overlapping CIDRs | Supported | Not allowed | Only with address translation |
| Direction | Consumer to provider | Both ways | Both ways |
| Transitive routing | Not applicable | No | Yes |
| US East price | $0.01 per endpoint AZ-hour + $0.01/GB | No hourly fee; $0.01/GB each way across AZs, free within one | $0.05 per attachment-hour + $0.02/GB |
| Good fit | SaaS, shared APIs, many consumers | A few VPCs needing full access | Many VPCs, VPN, Direct Connect |
If a consumer needs one service, use PrivateLink; if workloads talk both ways on many ports, route. Many organizations do both: a transit gateway for internal traffic, as in the hub-and-spoke topology, and PrivateLink for SaaS and cross-account APIs, as in an AWS landing zone.
What PrivateLink costs
At the time of writing (November 2026), the PrivateLink pricing page lists these US East (N. Virginia) prices:
- Interface endpoint: $0.01 per endpoint per AZ-hour, partial hours billed as full hours, plus $0.01 per GB for the first PB a month, $0.006 for the next 4 PB and $0.004 beyond.
- Gateway endpoint: free.
- Resource endpoint: $0.02 per resource-hour plus the same data tiers.
- Cross-Region: the provider pays $0.05 an hour per service for each active remote Region; the consumer adds inter-Region data transfer.
Six interface endpoints (ECR API, ECR Docker, CloudWatch Logs, STS, Secrets Manager, SQS) in three AZs cost 6 × 3 × 730 hours × $0.01 = $131.40 a month before data. If you keep NAT gateways anyway, the endpoints break even only above about 3,750 GB a month ($131.40 ÷ $0.035 per GB saved). Below that, you pay to keep traffic off the internet path, which is often the point.
The AWS PrivateLink diagram
Diagram contents
- Consumer VPC · account A
- Private subnet · use1-az1
- Private subnet · use1-az2
- Checkout app
- Endpoint ENI 10.0.1.25
- Endpoint ENI 10.0.2.25
- SQS endpoint ENIs
- S3 gateway endpoint
- Provider VPC · account B
- NLB · TCP 443
- Orders API targets
- Amazon SQS
- Amazon S3
- orders.example.com:443
- TCP 443 · PrivateLink
- proxy protocol v2
- sqs.us-east-1.amazonaws.com:443
- s3.us-east-1.amazonaws.com:443
- prefix-list route · free
How to read it:
- Two accounts, one CIDR. Both VPCs use 10.0.0.0/16; nothing routes between them, so it works.
- Endpoint ENIs in both AZs. Private DNS resolves
orders.example.comto 10.0.1.25 and 10.0.2.25; each app is drawn using its own zone's ENI. - Violet edges are PrivateLink. The ENIs reach the provider's NLB on TCP 443; the NLB forwards to the targets with proxy protocol v2.
- SQS works the same way. Its endpoint has an ENI in each subnet, drawn once.
- Green edges are the gateway endpoint: a route table entry sends S3 traffic to it at no charge.
- The Markdown block lists prices and limits.
Drawing PrivateLink diagrams clearly
- Put endpoint ENIs inside subnets, one per AZ. That is where they live, where security groups apply and what you pay for.
- Never join the two VPC boundaries directly. Draw edges from the ENIs to the NLB and label them PrivateLink, so nobody reads them as peering.
- Write the DNS name and port on the client's edge. Many PrivateLink failures are DNS failures: private DNS off, a resolver that cannot see the private hosted zone, or the wrong name.
- Show both CIDRs and both accounts; reviewers will ask about overlap and ownership.
- Tell gateway and interface endpoints apart by color or line style: one is a route, the other an interface with an IP.
Common mistakes: two-way arrows, a missing NLB, and on-premises clients using a gateway endpoint. For subnets and route tables, see how to diagram an AWS VPC; for service-level access, zero trust architecture.
Build it in Archboard
- Sign in with Google or GitHub and create a diagram.
- From the Network pack, add a VPC for the consumer (10.0.0.0/16) with two Subnet nodes, one per AZ.
- In each subnet, add a Compute node from the Cloud pack for the app and a Cloud resource for the endpoint ENI, labeled with its IP.
- Below the subnets, add two more Cloud resource nodes: the SQS interface endpoint and the S3 gateway endpoint.
- Add a second VPC for the provider with the same CIDR, holding a Cloud LB labeled NLB and a Compute node for the targets.
- Outside both VPCs, add a Queue for SQS and an Object Storage node for S3.
- Connect them with labeled edges: violet for PrivateLink, green for the gateway endpoint route.
- Add a Markdown block from the Core pack with prices and limits, plus Core Text notes.
If the endpoints are already in code, the Terraform to diagram and CloudFormation to diagram tools turn it into a first draft.
The example uses 15 diagram nodes, within the Free plan.
FAQ
What is the difference between an interface endpoint and a gateway endpoint? A gateway endpoint is a free route table target for S3 or DynamoDB, usable only inside its VPC. An interface endpoint puts private IPs in your subnets, reachable from peered VPCs and on premises, billed per AZ-hour and per GB.
Is AWS PrivateLink better than VPC peering? Neither is better in general. PrivateLink exposes one service in one direction and tolerates overlapping CIDRs. Peering connects whole networks both ways, has no hourly fee and needs unique address ranges.
Does PrivateLink work with overlapping CIDR blocks? Yes. The consumer connects to IPs in its own subnets and AWS delivers the traffic to the provider's load balancer, so the VPCs never route to each other.
How much does a VPC interface endpoint cost? At the time of writing (November 2026), $0.01 per endpoint per AZ-hour in US East plus $0.01 per GB for the first PB a month: about $14.60 a month in two AZs before data.
Can PrivateLink work across accounts and Regions? Yes. The provider allows principals from other accounts and accepts their connections. Providers can also enable cross-Region access, and select AWS services have supported it since November 2025; inter-Region data transfer costs extra.