Deploying Temporal Workers to Amazon ECS

This post details the configuration of Temporal Workers for deployment on Amazon ECS with Fargate. It covers essential aspects such as the Worker container setup (Dockerfile, dependency caching), implementing health checks via a lightweight HTTP endpoint, and handling graceful shutdowns using SIGTERM signals. Infrastructure considerations include ECS task definitions (no port mappings, secrets via SSM Parameter Store), IAM roles (Execution vs. Task roles), and ECS service configuration emphasizing Fargate Spot for cost savings. Scaling strategies focus on ECS Application Auto Scaling with low CPU targets and asymmetric cooldowns. Observability is addressed through CloudWatch logs, Container Insights, and Temporal Cloud metrics. The post also provides guidance on choosing between ECS and EKS based on team expertise, fleet size, and specific operational needs.