Using data volumes in tasks - Amazon ECS

Using data volumes in tasks

Amazon ECS on Fargate supports the following data volume options for containers.

  • Amazon EFS volumes — Provides simple, scalable, and persistent file storage for use with your Amazon ECS tasks. With Amazon EFS, storage capacity is elastic, growing and shrinking automatically as you add and remove files. Your applications can have the storage they need, when they need it. Amazon EFS volumes are supported for tasks hosted on Fargate or Amazon EC2 instances. For more information, see Amazon EFS volumes.

  • Bind mounts — A file or directory on the host is mounted into a container. Bind mount host volumes are supported for tasks hosted on Fargate or Amazon EC2 instances. For more information, see Bind mounts.

Fargate task storage

When provisioned, each Amazon ECS task on Fargate receives the following ephemeral storage for bind mounts. This can be mounted and shared among containers using the volumes, mountPoints and volumesFrom parameters in the task definition.

Fargate tasks using platform version 1.4.0 or later

For Amazon ECS on Fargate tasks using platform version 1.4.0 or later, each task receives 20 GB of ephemeral storage. The amount of storage is not adjustable.

For tasks using platform version 1.4.0 or later that are launched on May 28, 2020 or later, the ephemeral storage is encrypted with an AES-256 encryption algorithm using an AWS Fargate-managed encryption key.

Fargate tasks using platform version 1.3.0 or earlier

For Amazon ECS on Fargate tasks using platform version 1.3.0 or earlier, each task receives the following ephemeral storage.

  • 10 GB of Docker layer storage

  • An additional 4 GB for volume mounts.