To verify if an Elastic File System (EFS) is mounted to an Elastic Container Service (ECS) task, you can check the task’s container instance and look for the EFS mount point in the container’s file system.
You can also use the AWS CLI command describe-tasks
and check the output for the mountPoints
field, which should list the EFS file system if it is properly mounted.
You can also use the command df -h
to check if EFS is mounted or not.
Another way is to check the logs of the task and look for any error related to EFS mount.
In the container definition:
entrypoint: sh,-c
command: df -h && while true; do echo "RUNNING"; done
This should output the following in the task logs: