ladderlore
Request a guide
  • Type a service name, like S3 or IAM.

Service · Serverless · Builds on CLF-C02

AWS Fargate

Task sizes, storage, Fargate Spot, and when Fargate beats EC2 nodes.

You know from Cloud Practitioner

  • Serverless containers for ECS and EKS.
  • You pay for the CPU and memory a task asks for, while it runs.
  • Use EC2 for GPUs or specific instance types.
Read the Cloud Practitioner lesson
  • 0.25 vCPU

    0.5 to 2 GB
  • 1 vCPU

    2 to 8 GB
  • 4 vCPU

    8 to 30 GB
  • 16 vCPU

    32 to 120 GB
Four of the allowed CPU and memory sizes.
GPUs or custom AMI?
EC2
Steady high use, cost first?
EC2
Can tolerate stops?
Fargate Spot
Fargate
yesnoyesnoyesno
Fargate unless a question rules it out.

What it is

You choose a CPU and memory pair for the task, and only some pairs are allowed. Sizes run from 0.25 vCPU with 0.5 GB to 32 vCPU with up to 244 GB. Each task gets 20 GiB of ephemeral storage by default, which you can raise to 200 GiB. It is deleted when the task ends. For data that must last or be shared, mount Amazon EFS.

Fargate Spot runs tasks on spare capacity at a lower price, and it can stop a task with a two-minute warning. Use it for fault-tolerant, stateless work such as queue workers. Mix it with normal Fargate in a capacity provider so a base of tasks stays up.

What it is

Choose Fargate for the least operations work, for spiky or small loads, and for isolated tasks. Choose EC2 nodes for GPUs, tasks above 32 vCPU or 244 GB, custom AMIs, or the lowest cost at steady high use with Savings Plans.

Remember

  • Task size: 0.25 to 32 vCPU and 0.5 to 244 GB, in allowed pairs.
  • Ephemeral storage: 20 GiB by default, up to 200 GiB, gone when the task stops.
  • Shared or lasting files: mount Amazon EFS.
  • Fargate Spot: cheaper, two-minute warning, for fault-tolerant tasks.
  • No GPUs, no custom AMIs and no access to the host.

Remember

  • Steady, predictable high use can cost less on EC2 with Savings Plans.

On the exam

  • “Containers with the least operational overhead” points to Fargate.
  • “Interruption-tolerant container jobs at the lowest cost” points to Fargate Spot.
  • “Containers need GPUs” points to ECS or EKS on EC2, not Fargate.
  • “Containers must keep data after the task stops” points to Amazon EFS mounted on the task.