AWS · Serverless

AWS Fargate

Serverless compute for containers: run ECS tasks or EKS pods without provisioning or managing servers, paying per vCPU and memory.

On the SAA-C03 exam listServerless

What it is and what problem it solves

AWS Fargate runs containers for ECS and EKS without servers to manage. You specify CPU and memory per task or pod; Fargate provides isolated compute of that size, patches the underlying infrastructure, and bills per second while it runs. Each task gets its own kernel isolation and network interface.

Fargate Spot runs interruptible tasks on spare capacity at a discount, with a two-minute warning before interruption.

OrchestratorECS (AWS-native) or EKS (Kubernetes)EC2 launch type: you run the serversFargate: no servers to manageEC2 instancetasktaskEC2 instancetasktasktaskown CPU, RAMtaskown CPU, RAMtaskown CPU, RAM
Containers on AWS: pick an orchestrator (ECS or EKS), then run tasks on EC2 you manage or on Fargate

When to use it

  • Container services and jobs where you do not want to manage EC2 instances, AMIs or cluster capacity.
  • Spiky or unpredictable workloads, or many small services that would leave instances half empty.
  • Tasks that must be isolated from each other at the infrastructure level.

When to avoid it

  • GPU workloads or special instance features not available on Fargate: use EC2 capacity.
  • Very large, steady fleets where well-packed EC2 instances with Savings Plans cost less.
  • Tasks that need privileged access to the host.

Scaling model and bottlenecks

Fargate scales by starting more tasks; there is no cluster capacity to manage. Account quotas cap total concurrent Fargate vCPUs per Region (On-Demand and Spot separately), so request increases for large services.

Limits and quotas

ItemValueContextSource
Largest task size 32 vCPU with up to 244 GB of memory Linux tasks; Windows and smaller sizes have lower maximums. Source
checked
Ephemeral storage 20 GiB by default, up to 200 GiB Source
checked
Fargate Spot interruption warning 2 minutes Source
checked
Fargate On-Demand vCPU quota per Region 6 vCPUs by default
Can be raised with a quota request
Source
checked

Quotas and limits change. Check the linked source before designing around a number.

Cost model

What you pay for

Per second (with a one-minute minimum, five for Windows) for the vCPU and memory requested, by operating system and CPU architecture (Arm costs less), plus ephemeral storage above the default. Fargate Spot and Compute Savings Plans lower the rate. Logs, public IPv4 and data transfer are separate.

Where it is cost-efficient

Right-sized tasks with variable load, Arm (Graviton) tasks, and Fargate Spot for interruptible work.

Where costs grow

Over-requested CPU and memory (you pay for what you request, not what you use), and steady large fleets.

Cost controls and common surprises

Measure actual usage and right-size, use Graviton, buy Compute Savings Plans for the steady baseline, and use Fargate Spot for queues and batch.

Prices differ by Region and change over time; see the pricing page linked under Sources.

Security

Controls the service provides

Each task or pod runs in its own isolated environment with its own kernel; AWS patches the underlying hosts.

What you configure

Secure images and task roles, run in private subnets, and keep secrets out of images.

Logging and monitoring

CloudWatch Logs or FireLens; GuardDuty runtime monitoring for Fargate.

Related security services

ECS, EKS, ECR, IAM, Secrets Manager.

Shared responsibility

AWS manages and patches the hosts. You manage the container images and configuration.

Availability, backup and failure behavior

Spread tasks across subnets in several Availability Zones; ECS services and EKS replace failed tasks and pods.

Common service combinations

ECS services with an ALB, EKS Fargate profiles, EventBridge scheduled tasks, Batch on Fargate.

Business application examples

  • Fifty small microservices on Fargate, each sized exactly, with no instances to patch.

Exam cues and common confusions

  • Containers, no servers to manage: Fargate (with ECS or EKS).
  • Cheapest for interruptible containers: Fargate Spot.
  • GPUs or host-level control: EC2 launch type instead.

Related

Courses and lessons

Services, comparisons and patterns

Sources

Independent study material, not affiliated with or endorsed by Amazon Web Services. AWS and service names are trademarks of Amazon.com, Inc. or its affiliates.

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake