Fargate Based Temporal Server

advanced

Temporal workflow server on ECS Fargate — no Kubernetes or Helm required. Aurora PostgreSQL 15 Serverless v2, NLB on port 7233, Route53 DNS, and optional Web UI sidecar. Simpler and typically cheaper than the standard EKS/Helm approach.

Quick Start

Via CLI (recommended)

npx cdk-starter create

Then select "Fargate Based Temporal Server" from the prompt

Or scaffold directly

npx cdk-starter create --starter temporal-server

README

Fargate Based Temporal Server

Production-ready Temporal workflow server deployed on ECS Fargate with Aurora PostgreSQL 15 Serverless v2, Network Load Balancer on port 7233, and Route53 DNS.

Architecture

Internet
  └─ NLB :7233 (TCP)
       └─ ECS Fargate (temporalio/auto-setup, ARM64)
            └─ Aurora PostgreSQL 15 Serverless v2 (isolated subnets)
Route53 A record → NLB alias

Prerequisites

  • Node.js ≥ 20
  • AWS CLI configured (aws configure)
  • CDK bootstrapped (npx cdk bootstrap)
  • A Route53 hosted zone in your account
  • Docker (only if you want to build a custom Temporal image)

Configuration

Copy .env.example to .env and fill in your values:

cp .env.example .env

Required:

Variable Example Description
HOSTED_ZONE_DOMAIN example.com Route53 hosted zone
RECORD_NAME temporal Subdomain → temporal.example.com

Optional (with sensible defaults):

See .env.example for the full list.

Deploy

npm install

# Step 1: Deploy infrastructure only (VPC + Aurora + NLB) — recommended first
DEPLOY_TEMPORAL_SERVICE=false npx cdk deploy

# Step 2: Once Aurora is ready, enable the ECS task
DEPLOY_TEMPORAL_SERVICE=true npx cdk deploy

Or load from .env:

dotenv -- npx cdk deploy

Connecting your Temporal workers

Set TEMPORAL_ADDRESS in your worker/client config:

import { Connection } from "@temporalio/client";

const connection = await Connection.connect({
  address: "temporal.example.com:7233",
});

Enable the Web UI

Set ENABLE_UI=true and redeploy. The UI is accessible at http://<nlb-dns>:8080.

Tear down

npx cdk destroy

Note: The Aurora cluster is set to RemovalPolicy.SNAPSHOT — a manual snapshot is taken before deletion.

Stack outputs

Output Description
TemporalGrpcEndpoint Use as TEMPORAL_ADDRESS in workers and clients
TemporalNlbDnsName Raw NLB DNS
AuroraEndpoint Aurora cluster endpoint
AuroraSecretArn Secrets Manager ARN for DB credentials