t3-code-android-nightly/.repos/alchemy-effect/examples/aws-aurora-drizzle
Julius Marminge 6f9cea00ae
chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:22:30 -07:00
..
src chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170) 2026-10-05 13:22:30 -07:00
test chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170) 2026-10-05 13:22:30 -07:00
alchemy.run.ts chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170) 2026-10-05 13:22:30 -07:00
health-event.json chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170) 2026-10-05 13:22:30 -07:00
package.json chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170) 2026-10-05 13:22:30 -07:00
README.md chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170) 2026-10-05 13:22:30 -07:00
tsconfig.json chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170) 2026-10-05 13:22:30 -07:00

Drizzle + Aurora PostgreSQL + Lambda

Integration guide · AWS setup

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

AWS_TEST_SLOW=1 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.