Using data volumes in tasks - Amazon Elastic Container Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Using data volumes in tasks

Amazon ECS supports the following data volume options for containers:

  • Fargate ephemeral task storage – By default, Amazon ECS tasks that are hosted on Fargate using platform version 1.4.0 or later receive a minimum of 20 GiB of ephemeral storage. The total amount of ephemeral storage can be increased, up to a maximum of 200 GiB. You can do this by specifying the ephemeralStorage parameter in your task definition.

  • Amazon Elastic File System (Amazon EFS) volumes – These volumes provide simple, scalable, and persistent file storage for use with your Amazon ECS tasks. With Amazon EFS, storage capacity is elastic. It grows and shrinks automatically as you add and remove files. Your applications can have the storage that they need when they need it. Amazon EFS volumes are supported for tasks that are hosted on Fargate or Amazon EC2 instances. For more information, see Amazon EFS volumes.

  • Amazon FSx for Windows File Server volumes – These volumes provide fully managed Windows file servers. These file servers are backed by a Windows file system. When using FSx for Windows File Server together with Amazon ECS, you can provision your Windows tasks with persistent, distributed, shared, and static file storage. For more information, see FSx for Windows File Server volumes.

    Windows containers on Fargate do not support this option.

  • Docker volumes – These volumes are Docker-managed volumes that are created under /var/lib/docker/volumes on the host Amazon EC2 instance. Docker volume drivers (also referred to as plugins) are used to integrate the volumes with external storage systems, such as Amazon EBS. The built-in local volume driver or a third-party volume driver can be used. Docker volumes are supported only when running tasks on Amazon EC2 instances. Windows containers support only the use of the local driver. To use Docker volumes, specify a dockerVolumeConfiguration in your task definition. For more information, see Docker volumes.

  • Bind mounts – These volumes consist of a file or directory on the host, such as an Amazon EC2 instance or Amazon Fargate, that is mounted into a container. Bind mount host volumes are supported for tasks that are hosted on Fargate or Amazon EC2 instances. Bind mount host volumes use ephemeral storage on Fargate. The amount of ephemeral storage differs on the various Fargate platform versions. You can request up to 200 gibibytes (GiB) of ephemeral storage on Fargate Linux platform version 1.4.0 or later. For more information, see Bind mounts.