AWS Certified Solutions Architect - Professional 2020

Sign Up Free or Log In to participate!

Is it possible to use EFS/persistence volume with ECS Fargate ?

Is there a way if using EFS or persistence volume with ECS fargate service

Maks Khomutskyi

Can you please clarify your question or explain scenario?

3 Answers

Hi Rahul,

Normally, its not good practice to mount a foreign volume from within a Docker container….they should be transient and where persistence is needed, you’d normally use a local path on the Docker server host.  Fargate makes things more interesting since you don’t manage the Docker server host.  AWS specifically says that Fargate task storage is ephemeral…kind of treat containers on Fargate as stateless.

Depending on your need for persistence, you could build storage into your container app to save stuff to Dynamo, RDS or S3.  I have seen people using a script to download and upload data from their ECS Fargate-managed container to S3 for persistence.  You can find a few example out on StackExchange and Github.



I don’t agree stateless means ephemeral storage only. It’s okay to have completely stateless containers and still use some shared volume to read and write data. This is not making containers statefull. I will be not surprised if AWS adds EBS volumes mount option to Fargate tasks as well!

Regarding ECS service only EC2 instances can support persistent volumes (docker volumes), Fargate currently is out of scope.

Fargate now supports persistent storage using EFS volumes []

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?