Deploying Temporal Workers to Amazon ECS
Blog post from Temporal
Temporal Workers operate differently from standard web services as they long-poll the Temporal Server for tasks without receiving inbound HTTP traffic, eliminating the need for a load balancer. Amazon ECS with Fargate is well-suited for deploying these Workers, which are long-running processes that execute workflows and activities locally. The guide details the necessary ECS configuration, including setting up health checks, handling graceful shutdowns, and managing infrastructure with IAM roles and task definitions. Temporal Workers are ideal for Fargate Spot due to their stateless nature, offering significant cost savings as they retry in-progress activities on another Worker if a Spot instance is reclaimed. Scaling these Workers requires different considerations than web services, focusing on CPU utilization and asymmetric cooldowns, while observability is achieved through CloudWatch logs, Container Insights, and Temporal Cloud metrics. The guide suggests starting with ECS for those new to Kubernetes and considering EKS for larger fleets or when specific Kubernetes functionalities are needed, without changing the Worker code but only the surrounding infrastructure.