mirror of
https://github.com/VibedByKaKi/t3-code-android-nightly.git
synced 2026-10-09 11:51:15 +02:00
|
|
||
|---|---|---|
| .. | ||
| src | ||
| alchemy.run.ts | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
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, anAWS.EKS.Clusterwithcompute: "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 viaKubernetes.Manifest.src/Api.ts— an effectfulKubernetes.Deploymentin 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 typedpodTemplateescape hatch.src/SeedJob.ts— an inline-effect one-shotKubernetes.Job({ run }) that seeds the guestbook table when the Job is applied on deploy.alchemy.run.ts— thin composition: yields the shared infra, the taggedApi(viaEffect.provide(ApiLive)), an EXTERNAL nginxKubernetes.Deployment(registryimage:source), and theSeedJob.
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