Repository navigation
v2.3.0 — one machine
The simplest way to run the API on AWS: one virtual machine with Docker, still created, deployed and destroyed by Terraform from the pipeline.
Terraform
- The API runs on a single EC2
t3.microwith Amazon Linux 2023. On first boot it installs Docker, pulls the image from ECR, seeds the database and starts the API on port 80. - ECS, the load balancer and their roles are gone: 15 resources instead of 21, and about 0.03 USD per hour instead of 0.07.
- The machine reads the database URL from SSM Parameter Store at boot, so the password never appears in its user data.
- One role for the machine, scoped to its image, its parameter, its bucket and its log group, plus Session Manager for a shell without SSH keys.
- A new image means a new machine: Terraform replaces it and leaves the database untouched.
Pipeline
- The seeding step is gone: the machine does it on boot.
- The smoke test now waits for the machine to boot and the API to answer
/health/ready. - Measured: about 8 minutes to deploy, about 3 to destroy.
See terraform/README.md to run it.