AWS Builder Center

Build Private AWS Service Connectivity with AWS PrivateLink

Connect applications to AWS and third-party services privately using AWS PrivateLink, VPC endpoints, endpoint services, and least-privilege access.

Devops Enginner

Build Private AWS Service Connectivity with AWS PrivateLink

Modern cloud architectures often contain multiple VPCs and AWS accounts.
A common requirement is:
"How can one application access another service without exposing that service to the public internet?"
One solution is AWS PrivateLink.
AWS PrivateLink allows applications to privately access supported AWS services, partner services, SaaS applications, and services published by another AWS account.
The traffic stays on the AWS network path instead of requiring a public internet route.

The Problem

Imagine two VPCs:
Consumer VPC | | X | Provider VPC
The application in the Consumer VPC needs to access a service running in the Provider VPC.
One approach would be to make the service publicly accessible.
That creates unnecessary exposure.
Another approach is VPC peering or Transit Gateway.
Those solutions are useful in many architectures, but sometimes you want to expose only a specific service rather than provide broad network connectivity between entire VPCs.
This is where PrivateLink becomes useful.

What Is AWS PrivateLink?

AWS PrivateLink provides private connectivity between a VPC and a service.
A simplified architecture is:
Consumer VPC | v Interface Endpoint | v PrivateLink | v Endpoint Service | v Network Load Balancer | v Provider Application
The consumer does not need direct network access to the provider's entire VPC.
Only the published service is exposed.

Why PrivateLink?

PrivateLink can provide:
  • Private connectivity
  • Reduced public exposure
  • Service-level access
  • Cross-account service consumption
  • Better network isolation
  • Simplified SaaS connectivity
  • Controlled access to internal services
This makes it useful for large organizations and multi-account AWS environments.

Consumer and Provider

PrivateLink generally involves two sides.

Service Provider

The provider owns the service.
For example:
Provider VPC | v Application | v Network Load Balancer | v Endpoint Service

Service Consumer

The consumer wants to access that service.
For example:
Consumer VPC | v Interface Endpoint | v PrivateLink | v Provider Service
This separation is one of the important benefits of PrivateLink.

Complete Architecture

A typical architecture can look like:
+----------------------+ | Consumer VPC | | | | Application | | | | | v | | Interface Endpoint | +-------+--------------+ | | AWS PrivateLink | +-------v--------------+ | Provider VPC | | | | Endpoint Service | | | | | v | | Network Load Balancer| | | | | v | | Internal Application | +----------------------+
The consumer gets private access to the service without receiving general access to the provider VPC.

Interface VPC Endpoint

The consumer creates an interface VPC endpoint.
Conceptually:
Application | v Private IP | v VPC Endpoint ENI | v PrivateLink | v Service
The endpoint creates network interfaces inside selected subnets.
Applications can communicate with the endpoint using private IP addresses or DNS.

Endpoint Service

The service provider creates an endpoint service.
The endpoint service is generally backed by a Network Load Balancer.
Architecture:
Client Requests | v Endpoint Service | v Network Load Balancer | +---+---+ | | v v App A App B
The Network Load Balancer distributes traffic to the service targets.

Why Network Load Balancer?

PrivateLink endpoint services use Network Load Balancers as the service front end.
This creates a clean separation:
PrivateLink | v NLB | v Service Targets
The provider can therefore expose an application service without exposing the complete VPC network.

Cross-Account Architecture

PrivateLink is particularly useful when services are distributed across AWS accounts.
For example:
AWS Organization | +----+----+ | | v v Platform Application Account Account | | v v Service Consumer | +------ PrivateLink ------+ | v Application
The platform team can provide a shared internal service while application teams consume it privately.

Example Use Case

Suppose a company has a central payment service.
The payment service runs in:
Payment Account | v Payment Service
Multiple application teams need to consume it.
Instead of deploying a copy of the service into every VPC:
App VPC A ----+ App VPC B ----+----> Payment Service App VPC C ----+
PrivateLink can provide controlled private access.
The architecture becomes:
App VPC A --+ App VPC B --+--> PrivateLink --> Payment Service App VPC C --+
This is useful for shared internal platforms.

Security

Private connectivity does not automatically mean unlimited access.
You should still use security controls.
A security architecture can look like:
Consumer | v VPC Endpoint | v Security Group | v PrivateLink | v Endpoint Service | v NLB | v Application
Use security groups and endpoint/service policies where applicable.
Also control which AWS accounts or principals can connect to the endpoint service.

Endpoint Service Permissions

The service provider can control who is allowed to connect.
For example:
Endpoint Service | +---+---+ | | Account A Account B | | Allowed Allowed
Account C:
Account C | X Not Authorized
This provides an additional layer of access control.

DNS

DNS is important for making private services easy to consume.
Instead of applications using a hardcoded IP address:
10.0.12.25
use a meaningful service name:
payments.internal.example.com
Conceptually:
Application | v payments.internal.example.com | v Private Endpoint | v PrivateLink | v Payment Service
This makes service configuration easier to maintain.

PrivateLink vs VPC Peering

These technologies solve different problems.

VPC Peering

Provides network connectivity between VPCs.
VPC A<----------> VPC B
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article