sailfork / t3code-github / .repos/ alchemy-effect/ examples/ cloudflare-hyperdrive-aws-vpc
.repos/alchemy-effect/examples/cloudflare-hyperdrive-aws-vpc/README.md
Hyperdrive + Workers VPC + Aurora
A Cloudflare Worker queries Aurora PostgreSQL in private AWS subnets through Hyperdrive. Nothing in the VPC accepts inbound traffic: cloudflared runs on ECS Fargate and dials out to Cloudflare.
Worker → Hyperdrive → VPC Service → Tunnel → cloudflared (ECS) → Aurora - src/Database.ts — VPC, security groups, Aurora
- src/Connector.ts — Cloudflare Tunnel +
cloudflaredon ECS - src/Hyperdrive.ts — TCP VPC Service + Hyperdrive
- src/worker.ts — the Worker
Deploy
From the repository root:
pnpm install
cd examples/cloudflare-hyperdrive-aws-vpc
pnpm run deploy --profile testing --stage hyperdrive-vpc
curl "<url>" Aurora incurs charges until destroyed.
Destroy
pnpm run destroy --profile testing --stage hyperdrive-vpc