Posted On: Apr 8, 2020
Amazon Elastic Container Service (ECS) tasks running on both Amazon Elastic Compute Cloud (EC2) and AWS Fargate can now mount Amazon Elastic File System (EFS) file systems. ECS tasks using EFS will automatically mount the file systems specified by the customer in the task definition and make them available to the containers in the task across all availability zones in the region. This enables persistent, shared storage to be defined and used at the task and container level in ECS.
Applications like Wordpress, Drupal, and JIRA use EFS to store user data and application state, with active/standby container pairs running in different availability zones for high availability. Data science teams use EFS to store shared training data and home directories, allowing notebook containers and distributed training jobs to access the data in parallel.
To use EFS with ECS, customers can add one or more volume definitions to an ECS task definition. A volume definition includes an EFS file system ID, Access Point ID, and whether to enable IAM authorization or TLS encryption in transit. Container definitions within the task definition can specify the task definition volumes that should be mounted when that container is run. When a task that uses an EFS filesystem runs, ECS ensures that the EFS file system is mounted and available to the containers that need access to it.