t3-code-android-nightly/.repos/alchemy-effect/examples/aws-eks
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
alchemy.run.ts chore(refs): sync Alchemy reference to beta.76 (#10654) 2026-09-07 21:54:45 -07:00
package.json chore(refs): sync Effect and Alchemy references to rc.115 and beta.78 (#12327) 2026-09-17 23:21:25 -07:00
README.md chore(refs): sync Alchemy reference to beta.76 (#10654) 2026-09-07 21:54:45 -07:00
tsconfig.json Upgrade Effect and Alchemy betas (#4643) 2026-07-27 16:21:02 +02:00

AWS EKS Example

A "guestbook" app on EKS Auto Mode, fully TypeScript-driven — no YAML, no kubectl apply, no Helm.

  • src/infra.ts — the shared infrastructure: a VPC, an AWS.EKS.Cluster with compute: "auto" (the provider creates and owns the cluster + node IAM roles and enables managed compute, storage, and load balancing), a DynamoDB table, and a namespace applied as a raw manifest via Kubernetes.Manifest.
  • src/Api.ts — an effectful Kubernetes.Deployment in the tagged form (Api.make(props, impl)): an Effect HTTP server bundled into a generated image, exposed through an internet-facing NLB, with DynamoDB bindings that land IAM on the pod-identity role and inject the table name into the pod. Includes the typed podTemplate escape hatch.
  • src/SeedJob.ts — an inline-effect one-shot Kubernetes.Job ({ run }) that seeds the guestbook table when the Job is applied on deploy.
  • alchemy.run.ts — thin composition: yields the shared infra, the tagged Api (via Effect.provide(ApiLive)), an EXTERNAL nginx Kubernetes.Deployment (registry image: source), and the SeedJob.

Commands

bun install
bun run --filter aws-eks-example deploy
bun run --filter aws-eks-example destroy

The cluster control plane takes ~15 minutes to provision.

Try it

# outputs: apiUrl (note the :3000 — the NLB listens on the Service port), webUrl
curl "$apiUrl/entries"                            # seeded by SeedJob
curl -X POST "$apiUrl/entries?author=you&message=hello"
curl "$apiUrl/entries/ada"
curl "$webUrl"                                    # external nginx deployment

Optional Inspection

To inspect the cluster manually after deploy:

aws eks update-kubeconfig --name <clusterName output> --region "$AWS_REGION"
kubectl get pods -n guestbook