AWS PrivateLink vs. VPC peering vs. ngrok

Whether you’re migrating from on-premises to the cloud, or trying to deploy your services within your customers’ networks, you can’t get far without running into a critical issue: How do you allow two complex systems to communicate with one another securely? How can you bypass the dangers of crowded public networks and go straight from network A to network B?

If you’re delivering apps, APIs, or entire networks to AWS, they’ll have you believe you only have two options: AWS PrivateLink and VPC peering. Both services provide distinct features and benefits, and it's important to know the variances between them, and their individual strengths and weaknesses, to make an informed choice.

In truth, you have a third option that mitigates all of the cons one AWS-specific solutions while also simplifying the path to enabling and maintaining these complex cloud-to-cloud configurations.

Let's explore the complexities of AWS PrivateLink and VPC peering so you can decide which solution is best suited for your AWS cloud architecture requirements—or if ngrok serves as a compelling alternative.

What is AWS PrivateLink?

AWS PrivateLink is a service for establishing secure, private connections among VPCs, AWS services, and on-premises networks. AWS sets up endpoint interfaces within VPCs, enabling secure traffic flow without going through the public internet. This seclusion increases safety by reducing contact with potential dangers.

When you create a new connection, PrivateLink provisions new Interface VPC Endpoints, which are elastic network interfaces with private IP addresses, then uses Elastic Network Interfaces (ENIs) and endpoints-specific DNS entries to route traffic between your VPCs.

Use cases for AWS PrivateLink

AWS PrivateLink is especially beneficial for securely and effectively connecting to AWS services or third-party SaaS applications. It enables access across different regions and makes network setups easier by removing the requirement for complicated route table changes.

The primary use case for AWS PrivateLink is private access to specific applications. AWS PrivateLink allows you to securely access applications hosted in AWS without exposing them to the public internet. This feature is particularly useful for applications with high security and compliance requirements—for example, financial institutions can use PrivateLink to access critical banking applications securely, ensuring that customer data remains protected.

You can also opt for PrivateLink to handle remote access of shared services, like databases, monitoring tools, or other internal services throughout different VPCs. This way, you can centralize important assets and access various departments or project teams while maintaining security—you can set up a central database in a single VPC and utilize PrivateLink to provide access to various development, testing, and production environments in different VPCs.

Finally, you may use PrivateLink for hybrid clouds, where you need to connect on-premises data centers or colocation facilities to AWS services. For example, if you have a legacy ERP system on-premises, you can use PrivateLink to securely connect that to another service running on AWS for real-time data exchange as though they were colocated.

What is VPC peering?

VPC peering, another AWS offering, creates a direct link between two VPCs for seamless communication—as if they are on the same network. You can then transfer data between private IP addresses, ensuring traffic stays within the AWS network without requiring internet gateways, VPN connections, or physical hardware.

VPC peering is especially beneficial for companies wanting to set up multi-tier applications in various VPCs or regions using private IPv4/IPv6 addresses, as it allows for different types of traffic, such as TCP, UDP, and ICMP. VPC peering helps you create scalable, interconnected cloud environments by promoting efficient resource sharing and minimizing latency, allowing you to adjust to changing workloads and application requirements.

When you create a new VPC peering connection, AWS automatically updates the route tables of both VPCs to direct any traffic destined for the peer VPC's CIDR block through the peering connection. As long as the CIDR blocks of your two VPCs don’t overlap, you’ll have private networking without the latency and risk of the public internet.

Use cases for PVC peering

As an AWS shop, you’ll typically use VPC peering in two ways.

First, to share resources between two or more VPCs. VPC peering allows resources in different VPCs to communicate and share data seamlessly. This is useful for multi-tier applications where different components are deployed in separate VPCs for isolation and security.

Second, to share resources from a single centralized VPC. In this hub-and-spoke architecture, a central VPC (hub) can share common resources such as databases, DNS, and other services with multiple spoke VPCs via VPC peering.

PrivateLink vs. VPC peering: pros and cons

PrivateLink

Pros

  • Enhanced security: Traffic remains on the AWS network and is not exposed to the public internet, reducing your attack surface.
  • High availability: PrivateLink offers high availability with multiple Availability Zones
  • Can be shared between accounts: PrivateLink endpoints can be shared across multiple AWS accounts, simplifying access management for shared services.
  • Simplified compliance: Helps meet regulatory requirements by keeping traffic within AWS infrastructure.

Cons

  • Expensive: PrivateLink be expensive due to charges for data transfer, Network Load Balancer usage, and per-hour endpoint fees.
  • Limited connectivity: PrivateLink only supports TCP traffic.
  • Single-service only: Each PrivateLink can only be connected to one service.
  • Each connection adds complexity: Managing multiple PrivateLink connections can add complexity to network architecture, especially in large environments.
  • Performance impact: May introduce slight latency, especially for cross-region connections.

VPC peering

Pros

  • Low cost: VPC peering typically incurs lower costs than PrivateLink, with no additional data-processing fees.
  • No bandwidth limits: There are no bandwidth limitations, allowing for high-throughput communication between peered VPCs.
  • Security flexibility: VPCs support security groups and network ALCs for fine-grained access control.
  • Security group referencing: You can easily reference security groups across peered VPCs.
  • Flexibility: You can support TCP, UDP, and ICMP traffic, even across multiple AWS regions.

Cons

  • Complex at scale: Maintaining many peering connections can create a cumbersome mesh architecture.
  • No transit routing: VPC peering does not support transitive routing, meaning that even if VPC A is peered with B and C, B and C cannot communicate through A.
  • Hard connection limits: AWS limits the number of peering connections a VPC can have to 125 (300 on request), which can be restrictive in large-scale environments.
  • Limited access control options: VPC peering has limited options for access control compared with other connectivity solutions like AWS Transit Gateway.
  • Manual operations: You must manually update routing tables for each peered VPC.

Where ngrok solves the cons, from dev to prod

Your adoption of PrivateLink or VPC peering might start out different, but all deployments invariably converge on a single point: You inevitably spend more of your time dealing with complex networking configuration and endpoint management than you do building services or improving your clouds’ performance and availability. 

You stop being a developer or engineer and end up wearing all the hats of an operator.

ngrok takes a different approach in AWS environments, relying on just a few primitives. A standalone agent runs inside your VPCs and creates outbound tunnels to provide ingress and egress to nternal services. Finally, those tunnels connect to the secure ngrok network, which configures and modulates all the complex networking infrastructure for you. 

The agent works as a software-defined perimeter, combining the endpoint capabilities of PrivateLink with the direct connectivity between VPCs you get with peering. Even without changing security groups or worrying about NAT traversal, you can implement a zero-trust network access (ZTNA) model for all your HTTP, TCP, and TLS traffic. ngrok’s Traffic Policy module also lets you inject sophisticated middleware into the network path for features like SSL/TLS termination, authentication, rate limiting, and request/response transformation—all without modifying your application code.

This setup enables all the same use cases that you might otherwise lean on PrivateLink or VPC peering for, like sharing common resources, piping data between otherwise disparate systems, or linking development/staging environments to production data. But ngrok takes this functionality to new levels, also enabling additional use cases—site-to-site connectivity, device gateways, API gateways, and developer productivity, just to name a few—using the same agents and tunnels.

With ngrok, you get simpler networking configurations, more capabilities in production AWS environments, and don’t have to carry the ongoing cost of permanent infrastructure changes and expensive endpoint configurations. You also tap into ngrok’s ability to work across multiple cloud providers without other complex networking configurations, allowing you to go multi-cloud, or migrate away from AWS, with far less operational burden.

Plus, ngrok’s pay-as-you-go pricing model stays right-sized with the value you’re getting from secure tunnels as you scale up, preventing bill shock and vendor lock-in. Whether your goal is to skip the complexity and cost of AWS PrivateLink or deploy a solution without the limits of VPC peering, ngrok just might be a compelling alternative.

Time to bridge your virtual clouds with ngrok

Choosing the right networking solution for your AWS environment is no small feat. While AWS PrivateLink offers robust security and seamless access to AWS services, it’s expensive to run and creates a new layer of networking complexity, which is likely not your domain of expertise—or what you’re hoping to spend your valuable time on. VPC peering is the low-cost alternative, but has limited configurability and creates more operational headaches.

ngrok just might be the right fit for securely connecting services across networks or even multiple cloud providers.

You can create an ngrok account and create your first secure tunnel entirely for free to get on the right path away from the painful cons of both PrivateLink and VPC peering solutions.

If you’re thinking about migrating to ngrok as an alternative to AWS PrivateLink or custom VPC peering solutions, consider registering for the next edition of ngrok’s Office Hours. You’ll join hosts from our DevEd and Product teams, along with fellow developers and engineers, demo common solutions, learn about endpoints and tunnels together, and answer your pressing questions live.

Share this post
Cloud edge
Networking
Secure tunnels
Glossary
Features
Development
Production