title: Cannot write files on mounted volume aws efs
body: <p>I'm building a scalable and distributed architecture for workflows within our company by leveraging the use of Apache Airflow. I'm using ECS Fargate.</p>
  <p>Since this is a distributed architecture, a non-centralized file system is required in order to have a consistent-shared view across all machines (ie, the webserver needs to access the DAGs files, scheduler, and workers also).</p>
  <p>For such purpose, I'm using AWS EFS, I can successfully mount the file system into an EC2 instance, but I'm unable to write or create a file within it.</p>
  <p>This is the policy attached to the fs:</p>
  <pre><code>{
      &quot;Version&quot;: &quot;2012-10-17&quot;,
      &quot;Id&quot;: &quot;ExamplePolicy01&quot;,
      &quot;Statement&quot;: [
          {
              &quot;Sid&quot;: &quot;ExampleSatement01&quot;,
              &quot;Effect&quot;: &quot;Allow&quot;,
              &quot;Principal&quot;: {
                  &quot;AWS&quot;: &quot;*&quot;
              },
              &quot;Action&quot;: [
                  &quot;elasticfilesystem:ClientMount&quot;,
                  &quot;elasticfilesystem:ClientWrite&quot;
              ],
              &quot;Resource&quot;: &quot;arn:aws:elasticfilesystem:eu-west-1:XXXXXXXXXX:file-system/fs-aaaaaaa&quot;
          }
      ]
  }
  </code></pre>
  <p>and as the doc says:</p>
  <blockquote>
  <p>elasticfilesystem:ClientWrite  ------&gt; Provides an NFS client with
  write permissions on a file system.</p>
  </blockquote>
  <p>I'm mounting by executing the following command:</p>
  <pre><code> sudo mount -t efs -o tls,accesspoint=fsap-oooooooooooooooo fs-aaaaaaa:/ efs
  </code></pre>
  <p>and indeed, I can see the content, but got <code>Permission denied</code> every time I try to write.</p>
  <pre><code>[ec2-user@ip-XXXX ~]$ sudo mount -t efs -o tls,accesspoint=fsap-oooooooooooooooo fs-aaaaaaa:/ efs
  [ec2-user@ip-XXXX ~]$ df -h
  Filesystem      Size  Used Avail Use% Mounted on
  devtmpfs        2.0G     0  2.0G   0% /dev
  tmpfs           2.0G     0  2.0G   0% /dev/shm
  tmpfs           2.0G  616K  2.0G   1% /run
  tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
  /dev/xvda1      8.0G  2.7G  5.4G  33% /
  tmpfs           395M     0  395M   0% /run/user/1000
  tmpfs           395M     0  395M   0% /run/user/0
  127.0.0.1:/     8.0E     0  8.0E   0% /home/ec2-user/efs
  [ec2-user@ip-XXXX ~]$
  [ec2-user@ip-XXXX ~]$ cd efs/
  [ec2-user@ip-XXXX efs]$ touch a
  touch: cannot touch ‘a’: Permission denied
  [ec2-user@ip-XXXX efs]$
  [ec2-user@ip-XXXX efs]$ sudo touch a
  touch: cannot touch ‘a’: Permission denied
  [ec2-user@ip-XXXX efs]$ sudo su -
  Last login: Wed Aug 19 21:29:39 UTC 2020 on pts/0
  [root@ip-XXXX ~]#
  [root@ip-XXXX ~]# cd /home/ec2-user/efs/
  [root@ip-XXXX efs]#
  [root@ip-XXXX efs]# touch d
  touch: cannot touch ‘d’: Permission denied
  </code></pre>
  <p>Any help would be much appreciated. Thank you.</p>