First Fargate Task
Serverless containers.
Overview
The first Fargate task is the moment containers move from EC2-managed to AWS-managed compute. AWS owns the substrate (patching, scaling, capacity planning); the team owns the task definition, the image, and the IAM. Five primitives carry most operational use, and getting them right on task one means every subsequent service inherits the same patterns.
- Serverless container substrate. AWS runs the underlying hosts. EC2 patching, AMI rotation, and capacity planning go away.
- Per-second billing. Pay only for actual task runtime, billed at vCPU and memory granularity. Matches bursty and scheduled workloads.
- Multi-AZ networking via ENI. Tasks distribute across AZs and get VPC IPs through an Elastic Network Interface. Same security groups as EC2.
- ECS and EKS support. Fargate runs under either orchestrator; ECS Fargate is the simpler entry point for first deployments.
The approach
Start with ECS Fargate, declare task definitions as code, stream logs to CloudWatch, right-size from real telemetry. The patterns landed on task one are the patterns every later service will inherit, so spend the time getting them right.
- ECS Fargate first. Simpler control plane than EKS Fargate. Fewer moving parts on day one.
- Task definition as code. Terraform or CDK manages CPU, memory, image, env, secrets. Version-controlled config, reviewable diffs.
- CloudWatch logs plus right-sized resources.
awslogsdriver streams stdout; CPU and memory tuned from real usage rather than guesses. - Document the deploy. Image tag, env, secret ARNs, IAM role. Future investigation has the breadcrumbs it needs.
Why this compounds
Each task inherits the patterns the team set on the first one. Standard task definitions, standard logging, standard right-sizing all spread to new services without re-learning. By year two Fargate is the default for any container that doesn't explicitly need EC2.
- Reduced operational burden. AWS manages the substrate. Engineering time goes to product, not patches.
- Better cost efficiency. Per-second billing matches variable workloads. Idle compute disappears.
- Reusable patterns. Task-definition templates capture conventions. New services ship faster.
- Year-one investment, year-two habit. First task is the investment. By year two, every container ships on Fargate by default.