AWS › AWS Fargate

How does Fargate support integrating with EFS for tasks that need persistent, shared storage beyond a container's ephemeral storage?

Advanced

Answer

Fargate tasks can mount an Amazon EFS file system directly, giving containers access to persistent, shared storage that survives beyond the lifecycle of any individual task, which is particularly useful for stateful applications or workloads that need to share files between multiple running tasks, something that would not be possible using only Fargate's default ephemeral, temporary container storage.
{
  "volumes": [{
    "name": "efs-storage",
    "efsVolumeConfiguration": {"fileSystemId": "fs-12345678"}
  }]
}
Real-world example A content management application running on Fargate mounts an EFS file system so that multiple running tasks can all read and write to the exact same set of uploaded media files, something impossible with each task's own isolated ephemeral storage alone.

Common follow-ups: What performance considerations apply when multiple Fargate tasks access the same EFS file system concurrently?;How does mounting EFS affect Fargate task startup time?