Since April 2020 it’s now possible to mount an EFS file system from a task running on AWS Fargate.
There are some things you need to set up to make it work:
Security group
Ensure that the task can mount the EFS file system. For this you need allow access on port 2049. Edit this security group and add the relevant rule:
Service platform
This one was a bit tricky. You have to choose version 1.4.0 of the service platform when creating the service. LATEST will not work!
Mount the EFS file system
In the container section of your task definition you can mount the EFS file system.
This results in the following JSON in the task definition:
"mountPoints": [
{
"readOnly": null,
"containerPath": "/test/monkey",
"sourceVolume": "<NAME>"
}
],
"volumes": [
{
"efsVolumeConfiguration": {
"transitEncryptionPort": null,
"fileSystemId": "fs-f38e9d38",
"authorizationConfig": {
"iam": "DISABLED",
"accessPointId": "fsap-00539689e5a4c9907"
},
"transitEncryption": "ENABLED",
"rootDirectory": "/"
},
"name": "<NAME>",
"host": null,
"dockerVolumeConfiguration": null
}
]