Exposing Services Privately with AWS PrivateLink
This lesson explains how AWS PrivateLink exposes a single service privately to consumers in other VPCs and accounts without routing between the networks, which also avoids problems with overlapping IP addresses.
Learning outcomes
After completing this lesson, you will be able to:
- Describe how endpoint services and interface endpoints work.
- Explain how access is controlled on both the provider and consumer sides.
- Identify typical uses and the cost model.
How PrivateLink works
A service provider places its application behind a Network Load Balancer, or a Gateway Load Balancer for security appliances, and publishes it as an endpoint service. A consumer creates an interface endpoint for that service in its own VPC, which places elastic network interfaces with private IP addresses from the consumer's subnets. The consumer's applications connect to those addresses, and AWS carries the traffic privately to the provider's load balancer.
Traffic flows one way, from consumer to provider; the provider cannot initiate connections into the consumer's VPC, which limits what a compromised provider could do. Because no routes are exchanged between the two VPCs, their address ranges can overlap, and nothing else in either network becomes reachable. PrivateLink therefore connects a service, not a network.
The following diagram shows a consumer reaching a provider's service through PrivateLink.

Controlling access
Both sides control access. The provider lists the allowed principals, accounts, roles or the whole organisation, that may create endpoints to its service, and can require acceptance of each connection request, which suits SaaS providers that onboard customers individually. The consumer attaches security groups to its interface endpoint to decide which of its workloads may use it, and, for endpoints to AWS services, applies endpoint policies that restrict which actions and resources can be reached.
With private DNS names, consumers use the service's normal host name, which resolves to the endpoint inside their VPC; for a provider's own service, the provider must first verify ownership of the domain. Endpoint services can also be offered across Regions, so consumers in another Region connect privately without any peering or transit network.
Typical uses
AWS PrivateLink exposes a service through an interface endpoint in the consumer's VPC, so traffic stays on the AWS network, only that one service is reachable, and the two networks are never connected. It is how resources reach AWS services privately, through interface endpoints for STS, KMS, Secrets Manager and ECR. SaaS vendors use it to offer their services: a monitoring vendor can expose its ingestion API to thousands of customer VPCs. Platform teams use it for shared internal services, such as a payments platform exposed to every application account. Because PrivateLink connects services, not networks, it also works between networks with overlapping CIDR ranges, such as an acquired company's VPCs, without re-addressing. The following table summarises the uses.
| Use | Example |
|---|---|
| AWS services privately from a VPC | Interface endpoints for STS, KMS, Secrets Manager, ECR |
| SaaS offered to customers | A monitoring vendor exposes its ingestion API to thousands of customer VPCs |
| Shared internal services | A payments platform exposed to every application account |
| Networks with overlapping CIDRs | Services in an acquired company's VPCs reached without re-addressing |
When to use PrivateLink
Cost and limits
Interface endpoints are charged per hour in each Availability Zone where they are placed and per gigabyte processed, and the provider pays for its load balancer. An organisation with hundreds of VPCs that each create the same interface endpoints pays for them hundreds of times, which is why shared endpoints in a central VPC, reached over a transit gateway with Route 53 private hosted zones, are a common optimisation.
PrivateLink suits connections from many consumers to specific services. When many services in many VPCs must call each other in both directions, a transit gateway, which connects networks, or VPC Lattice, which connects services with routing and authorisation, is usually simpler than a growing set of endpoint services.
Offering a service privately to customers
A SaaS company wants customers to reach its API privately from their own VPCs, many of which use the same 10.0.0.0/16 range as the provider. Routing-based options (peering, transit gateway) break on overlapping CIDRs; PrivateLink does not, because consumers connect to an IP in their own VPC. The provider publishes an endpoint service in front of an NLB and allows specific customer accounts:
SERVICE_ID=$(aws ec2 create-vpc-endpoint-service-configuration \
--network-load-balancer-arns $NLB_ARN --acceptance-required \
--query ServiceConfiguration.ServiceId --output text)
aws ec2 modify-vpc-endpoint-service-permissions --service-id $SERVICE_ID \
--add-allowed-principals arn:aws:iam::444455556666:root
# In the customer's account
aws ec2 create-vpc-endpoint --vpc-endpoint-type Interface --vpc-id $CUSTOMER_VPC \
--service-name com.amazonaws.vpce.eu-west-1.$SERVICE_ID \
--subnet-ids $SUBNET_A $SUBNET_B --security-group-ids $SGContrast this with an internal microservices platform where dozens of teams call each other across accounts and need per-service authorisation and path-based routing. There, VPC Lattice is the better fit: services join a service network and an auth policy decides who may call what, for example allowing only principals from the payments OU to call POST /refunds.
Can PrivateLink connect a consumer and a provider whose VPC CIDRs overlap?
Show answer
Yes. The consumer reaches the service through an interface endpoint with an address in its own VPC, so the two networks never need to route to each other.
Exam Tips
Remember for the exam
- To expose a SaaS service privately to thousands of customer VPCs, use PrivateLink.
- Overlapping CIDRs between consumer and provider point to PrivateLink.
- PrivateLink traffic flows one way, from consumer to provider.
- Providers publish an endpoint service behind an NLB or GWLB; consumers create interface endpoints.
- Control who may connect with allowed principals and connection acceptance.