Generate ECS task definition JSON with containers, resources, and volumes.
Last verified: May 2026
Generate ECS task definition JSON with containers, resources, and volumes.
Required Fields
familynetworkModerequiresCompatibilitiesrequiresCompatibilities[0]cpuOutput will appear here...Your team is migrating a Node.js service from EC2-hosted ECS to Fargate. Initial task def attempt fails with 'invalid memory for cpu' because Fargate has restricted CPU/memory pairings (1 vCPU only supports 2/3/4/5/6/7/8 GB). The builder enforces valid combinations interactively, and adds the right execution role for ECR pulls. Time to working task definition: 10 minutes vs. the 2 hours of trial-and-error the team usually budgets for migration.
The ECS Task Definition Builder provides a guided form for constructing Amazon ECS task definitions. Task definitions are the blueprint for running containers on ECS and include settings for container images, CPU and memory allocation, port mappings, environment variables, logging, IAM roles, and more. This tool generates valid JSON task definitions that work with both Fargate and EC2 launch types, helping you avoid common mistakes in this complex configuration.
The builder collects task definition parameters (family name, launch type, CPU, memory, network mode, container definitions array, IAM roles, optional volumes) and assembles them into the canonical JSON structure ECS expects. It enforces Fargate's CPU/memory pairing rules, validates port mapping conflicts within a task, and surfaces required vs optional fields per launch type.
Always use the awsvpc network mode for Fargate (it's the only option) AND for EC2 launch type when you can. awsvpc gives each task its own ENI with VPC IP, enabling security group rules per task. The bridge mode shares the host's networking, making security group attribution impossible.
Sidecar patterns (logging, metrics, service mesh) on Fargate count against the task's CPU/memory allocation — not separately. A task with main app + Datadog agent + Envoy sidecar at 0.5 vCPU + 1 GB total often has the main app starved for resources. Always size the task to accommodate the FULL container stack, not just the main app.
ECS task definitions are immutable once created. To 'update' a task definition, you create a new revision. Running services keep using the old revision until you update the service. This makes rollback trivial (just point the service at an old revision number) but means leaked secrets in env vars persist in old revisions forever — always also rotate the secret.
Was this tool helpful?
Disclaimer: This tool runs entirely in your browser. No data is sent to our servers. Always verify outputs before using them in production. AWS, Azure, and GCP are trademarks of their respective owners.