Search code examples
amazon-web-servicescontainersamazon-ecs

Where are the volumes located when using ECS and Fargate?


I have the following setup (I've stripped out the non-important fields):

{
    "ECSTask": {
      "Type": "AWS::ECS::TaskDefinition",
      "Properties": {
        "ContainerDefinitions": [
          {
            "Name": "mysql",
            "Image": "mysql",
            "MountPoints": [{"SourceVolume": "mysql", "ContainerPath": "/var/lib/mysql"}]
          }
        ],
        "RequiresCompatibilities": ["FARGATE"],
        "Volumes": [{"Name": "mysql"}]
      }
    }
}

It seems to work (the container does start properly), but I'm not quite sure where exactly is this volume being saved. I assumed it would be an EBS volume, but I don't see it there. I guess it's internal to my task - but in that case - how do I access it? How can I control its limits (min/max size etc)? How can I create a backup for this volume?

Thanks.


Solution

  • Fargate does not support persistent volumes. Any volumes created attached to fargate tasks are ephemeral and cannot be initialized from an external source or backed up, sadly.

    https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html