docs/private-networking/overview.mdx
Private networking lets your Trigger.dev tasks reach databases, caches, and internal APIs that live inside your own AWS VPC, without exposing them to the public internet. Connectivity is established over AWS PrivateLink, so traffic stays on the AWS backbone.
<Info> Private networking is a Pro and Enterprise feature. If you'd like access, [get in touch](/community). </Info>AWS PrivateLink is a managed service that creates a private, one-way connection between two AWS accounts without using the public internet, NAT gateways, internet gateways, or VPN tunnels.
It works by pairing two resources:
The connection is unidirectional: only the endpoint side can initiate connections. Your VPC cannot reach into ours.
Any TCP service running inside your VPC. Common use cases include:
If your resource is reachable from a Network Load Balancer in the same VPC, it can be exposed to Trigger.dev via PrivateLink.
When you add a private connection in the dashboard, the following happens:
<Steps> <Step title="You expose your resource"> You create an internal NLB in front of your resource and a VPC Endpoint Service that points to it. You add Trigger.dev's AWS account as an allowed principal so we're permitted to connect. </Step> <Step title="We provision a VPC Endpoint"> Once you submit the endpoint service name in the Trigger.dev dashboard, we provision a VPC Endpoint in our AWS account in the region you chose. The endpoint creates an ENI with a private IP that we wire up to reach your service. </Step> <Step title="Your tasks can reach the endpoint"> Once the connection is **Active**, the dashboard shows the assigned IP. Pods running your tasks are network-authorized to connect to it. </Step> </Steps>When the connection becomes Active, the dashboard shows the assigned endpoint IP. Plug it into the connection-string environment variable your task already reads (for example, DATABASE_URL set on the Environment Variables page):
import { task } from "@trigger.dev/sdk";
import { Client } from "pg";
export const queryDatabase = task({
id: "query-database",
run: async () => {
// DATABASE_URL is set in the Trigger.dev dashboard to the connection's
// assigned IP shown in Private Connections.
const client = new Client({
connectionString: process.env.DATABASE_URL,
});
await client.connect();
const result = await client.query("SELECT NOW()");
await client.end();
return result.rows;
},
});
Private networking is set up so that each organization's connections are completely isolated from every other organization. Three layers enforce that:
Customer VPC Endpoints are provisioned in a dedicated AWS account that is separate from the account that runs Trigger.dev's task workers. The dedicated account does nothing else — it only hosts customer endpoints. This limits the blast radius of any misconfiguration: even a misbehaving endpoint cannot reach worker infrastructure beyond the routes we explicitly define.
Inside the Kubernetes cluster that runs your tasks, the default network policy denies all traffic to private IP ranges. When your organization creates a connection, we generate a CiliumNetworkPolicy that:
A pod from another organization has neither the matching label nor a matching policy — its connection attempts to your endpoint IPs are dropped at the network layer before they ever reach an ENI.
PrivateLink itself enforces a second layer of authorization. Your VPC Endpoint Service has an explicit list of allowed_principals — only AWS accounts you list can even establish a connection. Trigger.dev provides each org with the same Trigger.dev AWS account ID, but the AWS account ID alone is useless without the matching CiliumNetworkPolicy on our side. To reach your endpoint, traffic must:
All three conditions must be true. No organization can route traffic to another organization's resources.
<Warning> AWS account IDs are not secrets, but the VPC Endpoint Service name is also not enough on its own — you must explicitly add Trigger.dev's account to your endpoint service's allowed principals before any connection works. We'll never see your service unless you authorize us. </Warning>