Cloudflare Hyperdrive → AWS Private Database

Two supported paths. Both use Cloudflare Tunnel (cloudflared) running inside your AWS VPC to bridge Hyperdrive to a private RDS / Aurora / self-managed database. Both are currently in Beta.

1. Workers VPC — Recommended

Worker Hyperdrive VPC Service (TCP) Cloudflare Tunnel AWS RDS (private subnet)

Step 1 — Run cloudflared in your VPC

Deploy cloudflared on any host that can reach your database and egress to Cloudflare: a small EC2 instance, an ECS Fargate task, or an EKS pod. Create the tunnel in the Workers VPC dashboard and save the tunnel ID.

Step 2 — Create a TCP VPC Service

npx wrangler vpc service create my-rds \
  --type tcp \
  --tcp-port 5432 \
  --app-protocol postgresql \
  --tunnel-id <TUNNEL_ID> \
  --ipv4 <RDS_PRIVATE_IP>

Use --hostname instead of --ipv4 if you prefer a DNS name. For MySQL, set --tcp-port 3306 --app-protocol mysql.

Step 3 — Create Hyperdrive via the service ID

npx wrangler hyperdrive create my-hd-config \
  --service-id <VPC_SERVICE_ID> \
  --database <DB_NAME> \
  --user <DB_USER> \
  --password <DB_PASS> \
  --scheme postgresql
TLS verification: Workers VPC defaults to verify_full. RDS uses publicly trusted certificates, so this works without extra flags. If you ever use a self-signed cert, add --cert-verification-mode verify_ca or disabled (dev only).

2. Tunnel + Cloudflare Access

The original Beta path. It secures the tunnel with a Cloudflare Access application and a non-expiring Service Auth token. More moving parts, but fully supported if your org already uses Access.

Worker Hyperdrive Cloudflare Access Cloudflare Tunnel AWS RDS (private subnet)

Step 1 — Create a tunnel and assign a public hostname

In the Cloudflare dashboard (Zero Trust → Networks → Connectors → Tunnels), create a tunnel, run cloudflared in your VPC, then add a public hostname that routes TCP to your RDS endpoint:

Type: TCP
URL:  my-rds.xxx.us-east-1.rds.amazonaws.com:5432

Step 2 — Secure the tunnel with Access

Create a Self-hosted and private Access application for the hostname. Add a Service Auth policy and generate a non-expiring Service Token. Copy the Client ID and Client Secret.

Step 3 — Create Hyperdrive with Access credentials

npx wrangler hyperdrive create my-hd-config \
  --host=rds.yourdomain.com \
  --user <DB_USER> --password <DB_PASS> \
  --database <DB_NAME> \
  --access-client-id <ID> \
  --access-client-secret <SECRET>

You must omit --port. Hyperdrive routes database messages to the tunnel’s public hostname; the tunnel’s service config handles port routing internally.

Comparison

DimensionWorkers VPCTunnel + Access
Access application neededNoYes
Service token neededNoYes (non-expiring)
Public hostname neededNoYes
Dashboard stepsMinimalMultiple (Tunnel + Access + Token)
TLS verification defaultverify_fullDoes not verify origin cert by default
Recommended forNew setups, clean IaCOrgs already using Cloudflare Access

AWS-Specific Practical Notes

Bot Fight Mode: If your org uses Super Bot Fight Mode, keep Definitely Automated set to Allow. Otherwise tunnels may fail with websocket: bad handshake.

Sources: Connect to a private database using Workers VPC · Connect to a private database using Tunnel