sailfork / t3code-github / .repos/ alchemy-effect/ examples/ aws-aurora-drizzle
.repos/alchemy-effect/examples/aws-aurora-drizzle/README.md
Drizzle + Aurora PostgreSQL + Lambda
Deploy
From the repository root:
pnpm install
cd examples/aws-aurora-drizzle
pnpm deploy --profile testing --stage aurora-example Use us-west-2; changing region also requires changing the subnet availability zones. Aurora incurs charges until destroyed.
Query
aws lambda invoke --region us-west-2 \
--function-name '<functionName>' \
--cli-binary-format raw-in-base64-out \
--payload file://health-event.json response.json
cat response.json Use the printed function name and your AWS CLI credentials. The Function URL requires SigV4-signed requests.
| Method | Path | Body |
|---|---|---|
| GET | /health | — |
| GET | /todos | — |
| POST | /todos | {"id":"aaaaaaaa-0000-4000-8000-000000000001","title":"Ship it"} |
| PATCH | /todos/<uuid> | {"done":true} |
| DELETE | /todos/<uuid> | — |
Schema and connections
Private network · Deployment-only bootstrap · IAM and verified TLS
The bootstrap creates the initial schema and restricted login. Later schema changes need versioned migrations.
Live test
ALCHEMY_PROFILE=testing bun test test/integ.test.ts Creates real AWS resources and destroys them afterward. Setup and cleanup can each take several minutes.
Destroy
pnpm destroy --profile testing --stage aurora-example This deletes the database data. Wait for cleanup to finish; reuse the same profile and stage if interrupted.