Engineering notes — ExplainersVercel Secure Compute AWS PrivateLink setup, step by step
How to set up AWS PrivateLink endpoints from Vercel Secure Compute, wire them to RDS or internal services, and connect from a Next.js app safely.
Enterprise teams on Vercel Secure Compute can now reach AWS services over PrivateLink directly from their Vercel network. If your RDS, Redshift, Snowflake or internal NLB-backed API exposes an AWS PrivateLink endpoint service, you can attach an endpoint from the Vercel dashboard and hit it from functions, sandboxes and builds on that network.
This post walks through what Vercel shipped, how a realistic setup might look for RDS and internal APIs, and what to watch for when you connect it to a Next.js app.
What Vercel actually shipped for PrivateLink
Vercel describes the change like this:
"Enterprise teams using Secure Compute can now create and manage AWS PrivateLink endpoints directly from the Vercel dashboard."
The key points from the announcement:
- Endpoints live inside your team’s dedicated VPC attached to Secure Compute.
- That VPC uses your network’s AWS region.
- Endpoints belong to the network, and are shared by its connected project environments.
- Vercel Functions, Vercel Sandbox and builds connected to that network can reach AWS-hosted backends over the AWS private network.
- You can only add an endpoint in Vercel after the backend is exposed as a published AWS PrivateLink endpoint service.
- Examples of supported backend types from the announcement:
- RDS, Aurora, Redshift
- Snowflake
- MongoDB Atlas
- Internal services behind a Network Load Balancer
Pricing from the same post:
- Each Secure Compute network includes one AWS PrivateLink endpoint.
- Additional endpoints cost $30/month each.
- PrivateLink data transfer is $0.04 per GB.
The UI entry point Vercel gives is:
"In Team Settings → Networking, open your Secure Compute network and choose Add Endpoint from the PrivateLink tab."
Vercel links to their Secure Compute PrivateLink documentation from that post, but that doc isn’t part of the material here, so I’ll focus on what’s explicitly described and treat the missing pieces as design choices you’ll confirm in the docs.
If you are already working on Vercel-heavy apps and care about infrastructure details like this, you may also find my write-up on Vercel Standard builds usage-based billing useful context for planning networks and build behaviour together.
The scenario: RDS and an internal API from Secure Compute
To make this concrete, I’ll frame it as a case study of a typical setup I’d implement.
You have:
- A Secure Compute network in one AWS region.
- A Postgres or MySQL database on RDS in the same region, exposed via an AWS PrivateLink endpoint service.
- An internal HTTP API fronted by a Network Load Balancer, also exposed as a PrivateLink service.
- A Next.js app on Vercel where:
- API routes run as Vercel Functions.
- Background job code or experiments run in Vercel Sandbox.
- CI builds for that app are attached to the same Secure Compute network.
The goal is:
- Reach RDS and the internal API without traversing the public internet, so all traffic stays on AWS’ private network between your Vercel VPC and your AWS accounts.
- Use standard connection code from the app side, so your Next.js functions just talk to hostnames and ports, not custom tunnelling logic.
From the Vercel side, the workflow has three high-level steps:
- Make sure the AWS service exposes a published PrivateLink endpoint service.
- Add a PrivateLink endpoint in your Secure Compute network.
- Point your Next.js app and other workloads on that network at the right hostnames.
The first step happens fully in AWS. Vercel only requires that “the backend must already be exposed through a published AWS PrivateLink endpoint service,” so I’ll treat that as a prerequisite rather than walk through the AWS console screens.
Step 1: Prepare the AWS side (conceptually)
Because Vercel’s post doesn’t describe the AWS-side process, I’ll keep this conceptual and name the minimum pieces you’d typically have ready before touching Vercel:
- For RDS: either
- Use a managed integration that exposes the database over PrivateLink, or
- Place RDS in a VPC and expose it via an AWS PrivateLink endpoint service (if supported for your engine/plan).
- For an internal HTTP API:
- Run your service behind a Network Load Balancer.
- Attach a PrivateLink endpoint service to that NLB.
- Publish that service so other AWS principals (like Vercel’s AWS-side identity for your Secure Compute VPC) can create endpoints.
Vercel doesn’t describe how they authenticate or which AWS account owns the Secure Compute VPC in this announcement. The exact permission model and service acceptance workflow will be in their Secure Compute PrivateLink documentation.
The safe rule is: you shouldn’t expect to see your service from Vercel until it’s a published endpoint service in AWS.
Step 2: Add a PrivateLink endpoint in Vercel
The one concrete piece of UI navigation we do get is the path to create the endpoint on the Vercel side.
The “trying it” path, using Vercel’s wording exactly, would be:
- In your Vercel dashboard, go to Team Settings → Networking.
- Open your Secure Compute network.
- Open the PrivateLink tab for that network.
- Choose Add Endpoint.
From here, Vercel doesn’t list the specific fields on the form in this announcement. Expect something that:
- Identifies the AWS region (inferred from the Secure Compute network’s region).
- Lets you select the PrivateLink endpoint service to connect to, or paste its service name.
- May ask for tags or a description so you can tell RDS and the internal API apart later.
Once you’ve created the endpoint:
- It now lives in your team’s dedicated VPC.
- It belongs to the network, so every project environment attached to that Secure Compute network can use it.
- Vercel Functions, Vercel Sandbox and builds that run on that network can hit the AWS resource through this endpoint.
If you only need one backend, you’re inside the included quota. If you need multiple AWS services, the pricing matters, because you pay per extra endpoint.
Thinking about cost and endpoint design
Given:
- First endpoint per network: included.
- Extra endpoints: $30/month each.
- Data transfer: $0.04/GB.
You’ll want to group services by network design rather than spreading them out across many networks casually. I’d keep a short inventory like:
- Network A: RDS + internal API → 2 endpoints → +$30/month.
- Network B: Analytics stack (Redshift + Snowflake) → 2 endpoints → +$30/month.
Then compare that to consolidating onto a single network if your security model allows it.
Step 3: Wire a Next.js API route to RDS over PrivateLink
Once the endpoint exists and the Secure Compute network can see your database’s PrivateLink DNS name, your code can stay very boring. From the app’s perspective it’s a host, port, and credentials.
Here’s an illustrative Next.js route handler using a placeholder hostname, not from Vercel’s docs, just the shape I would expect in a project:
// app/api/users/route.ts (Next.js route handler)
import { NextRequest, NextResponse } from "next/server";
import { Pool } from "pg";
const pool = new Pool({
host: process.env.RDS_PRIVATE_HOST, // e.g. <rds-privatelink-host>
port: Number(process.env.RDS_PORT ?? 5432),
user: process.env.RDS_USER,
password: process.env.RDS_PASSWORD,
database: process.env.RDS_DB,
ssl: { rejectUnauthorized: true },
});
export async function GET(_req: NextRequest) {
const client = await pool.connect();
try {
const result = await client.query("SELECT id, email FROM users LIMIT 10");
return NextResponse.json({ users: result.rows });
} finally {
client.release();
}
}The moving parts here are all standard Next.js and pg usage, nothing PrivateLink-specific. The assumption is that when this function runs on Secure Compute, RDS_PRIVATE_HOST resolves through the Vercel VPC’s DNS to the PrivateLink endpoint, not a public IP.
How you get that DNS name and confirm DNS routing is correct will depend on Vercel’s Secure Compute PrivateLink documentation and what they expose in the dashboard.
The practical test I’d run after wiring this up would be:
- Hit
/api/usersfrom a browser. - Confirm the query succeeds and watch RDS connection logs in AWS.
- Confirm that no incoming traffic is recorded on any public-facing RDS endpoints or internet gateways for that path.
If you want more background on how I think about function behaviour and limits on Vercel, my post on the Vercel Functions 20MiB request body limit covers another piece of the same environment your PrivateLink-connected handlers will run in.
Step 4: Use the same endpoint from Vercel Sandbox and builds
Vercel calls out three types of workloads that can use PrivateLink endpoints on Secure Compute:
- Vercel Functions
- Vercel Sandbox
- Builds connected to the network
That means once you’ve created an endpoint on a given network:
- The same code and environment variables can be used in your app’s functions and in sandbox scripts, as long as they’re attached to that network.
- Build-time tasks that need to talk to internal APIs or databases can do so over PrivateLink as well.
I’d treat this as a chance to make your environments behave the same way across:
- Local development hitting a VPN or SSH tunnel into the AWS VPC.
- Preview/production running on Secure Compute hitting the same internal endpoints via PrivateLink.
The alternative, where local and production environments use different hosts or protocols, usually bites you later.
Common gotchas to plan for
Some of the rough edges here are implied by how PrivateLink generally works and by the details Vercel does share.
- Endpoint per service: AWS PrivateLink is usually “one endpoint per target service.” Combined with Vercel’s per-endpoint pricing, that means sprawl gets expensive. Consolidate where it makes sense.
- Region coupling: Vercel states that endpoints “use the network’s AWS region.” If your RDS or internal API live in a different AWS region from your Secure Compute network, you’ll need to resolve that, either by changing network region or AWS deployment.
- DNS expectations: You need a clear story for how function and sandbox DNS resolution works for your endpoint hostnames. That design belongs in your PrivateLink runbook, next to your AWS-side configuration.
- Service publication: If your AWS-side team forgets to publish the PrivateLink endpoint service, you won’t be able to attach it from Vercel. The announcement is explicit that the backend must be exposed through a published service first.
When I wouldn’t rush to use it
There are a few situations where I wouldn’t wire this in yet, or I’d be cautious:
- Small teams without strict network isolation requirements: If a normal database connection over TLS from Vercel to a public RDS endpoint already meets your security and compliance needs, adding PrivateLink might add more AWS complexity than it solves.
- Multi-cloud sprawl without AWS concentration: If your internal services aren’t already in AWS, forcing them into AWS just to speak PrivateLink doesn’t make sense.
- Loose endpoint hygiene: If your org isn’t disciplined about network design, you can end up with a tangle of networks and endpoints driving up both the $30/endpoint fee and the $0.04/GB data charges.
When the compliance or data sensitivity story requires private network paths, this trade-off changes, and PrivateLink on Secure Compute starts to look necessary instead of optional.
If you’re already deep into Vercel and Next.js and want help planning a Secure Compute and PrivateLink rollout that doesn’t surprise you on cost or complexity, I work with teams on exactly that kind of infrastructure design as a Next.js developer.
Sources
- AWS PrivateLink endpoints are now available on Secure Compute — Vercel changelog, 2026-11-24