Compute
Ship the ShopLite API: an image in ECR, an Application Load Balancer with optional HTTPS, ECS Fargate tasks with least-privilege roles, autoscaling, and versioned deploys.
The network is ready; now something runs in it. You'll write the actual ShopLite API (a tiny Node service), containerise it, and have Terraform create everything needed to serve it on a public URL. This stage covers the Terraform techniques real service stacks rely on: `jsonencode` for embedded JSON, dynamic blocks and `null` for optional settings, a genuine `depends_on`, `ignore_changes` so the autoscaler and Terraform don't fight, and a clear boundary between 'infrastructure change' and 'deploy a new version'.
+ ShopLite gains: the ShopLite API on ECS Fargate behind an ALB with a public URL, images in ECR, optional HTTPS with ACM + Route 53, autoscaling, and versioned deploys via image_tag
- 3.1
Write ShopLite and Push It to ECR
The ShopLite API as a container image, version `1.0.0`, stored in an immutable, scanned ECR repository that Terraform manages.
35 minCents — ECR storage for a ~50 MB image2 break-its - 3.2
An Application Load Balancer (with Optional HTTPS)
A public ALB across both public subnets with a target group health-checking `/healthz`, plus an optional HTTPS listener, ACM certificate, and DNS record that switch on when you provide a domain.
40 min~$0.025/hour for the ALB (+ tiny LCU charges)2 break-its - 3.3
ECS Fargate: Roles, Task Definition, Service
ShopLite `1.0.0` running as two Fargate tasks in private subnets, registered behind the ALB, logging to the imported log group, and answering on the public URL.
50 min~$0.02/hour for two 0.25 vCPU / 0.5 GB ARM tasks3 break-its - 3.4
Autoscaling and Versioned Deploys
ShopLite scales between 2 and 6 tasks on CPU and request load, Terraform never fights the autoscaler, and version `1.1.0` rolls out with zero downtime by changing one variable.
40 minSame as 3.3, briefly more during the load test2 break-its