AWS Fargate
AWS Fargate is a serverless Amazon Web Services compute engine for containers, used by Amazon Elastic Container Service (ECS) and Amazon Elastic Kubernetes Service (EKS) to run containers without managing the underlying EC2 instances.
Key points
- In the AWS Management Console, ECS clusters containing Fargate and EC2 tasks are displayed separately.
- Executes each ECS task or EKS pod in its own kernel as an isolated computing environment, improving security.
- Packages the application in containers by specifying only CPU and memory requirements plus IAM policies; a Fargate task does not share its underlying kernel, memory, CPU, or elastic network interface (ENI) with another task.
- Task-level CPU and memory must be chosen from fixed pairings, e.g. 0.25 vCPU with 512 MiB–2 GB, up to 4 vCPU with 8–30 GB; Linux tasks on platform version 1.4.0+ can also go up to 16 vCPU (32–120 GB) or 32 vCPU (60/120/244 GB) — the higher vCPU tiers are Linux-only.
- Automatically scales the compute environment to match the container’s resource requirements.
- Fargate doesn’t support the branch-ENI “security groups for pods” feature used on EC2 worker nodes, since each Fargate pod already gets its own dedicated ENI. Fargate pods can still be assigned custom security groups (rather than only the cluster security group) via an EKS
SecurityGroupPolicy, a capability added in June 2021. - Storage types supported for Fargate tasks:
- Amazon EFS volume — for persistent storage.
- Ephemeral Storage — non-persistent bind-mount storage; every task on platform version 1.4.0+ (Linux) or 1.0.0+ (Windows) gets 20 GiB by default, configurable up to 200 GiB per task via the
ephemeralStorageparameter.
- Manages cluster size, scheduling, and environment maintenance, automatically provisioning and managing backend instances so a Docker application can be deployed without managing the underlying servers.
- Distinct from the EC2 launch type for ECS/EKS, which gives full control over the underlying compute instances; choose EC2 when that control is required and Fargate when server management should be removed entirely.