- Newest
- Most votes
- Most comments
You do not need to mount the file system on the EC2 instance to be able to (bind?) mount it in the task. ECS is able to mount the EFS volume inside the task directly (without configuring the EC2 instance). We use this mechanism to mount the volume into a Fargate task as well (with Fargate you don't get access to the instance). It's unclear where you are running the df
command but if you can ECS exec into the container you should be able to verify the volume has been mounted in the folder you specified in the task def. This blog should provide more details.
Hi - here are the steps to mount EFS using an ECS task, so check that you have completed every step - https://docs.aws.amazon.com/AmazonECS/latest/developerguide/tutorial-efs-volumes.html.
I would look at the userdata section and ensure the mount is specified with the correct mount options for EFS (you can see these in the EFS console) and also check the userdata script logs ( /var/log/user-data.log ) to make sure there are no subsequent errors.
Thanks for the reply. I dont have a user-data.log file in /var/log or /var/log/ecs. What I have under /var/log/ecs is: ecs-agent.log, audit.log and ecs-volume-plugin.log. I am wondering where the log for actual mounting is... Thanks.
Relevant content
- asked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 19 days ago
I do want to mount it via the task. I mentioned I mounted manually myself to make sure that the security groups used between efs and ec2 instances are set correctly and the NFS inbound rule to efs works fine. I did df on the EC2 instance to see if the task has done the mounting or not.
I think there is a problem with one of the roles, either the role assigned to the task or the role used for when create the cluster, as that rule is the one that EC2 uses or inherits as well. which one is involved in the mounting process, the one defined in the task or the one define in cluster? also tasks have two: task role and task execution role...I guess my docker image uses task role, and the task execution role is the one used for fetching images from gitlab and accessing Secrets manager. but is it involved in mounting efs too?
The role you need to have EFS permissions for is the IAM role (not the IAM execution role). You can refer to this blog/tutorial