# Persistence Storage using AWS EFS

**URL:** <https://discourse.nodered.org/t/persistence-storage-using-aws-efs/72051>\
**Category:** General\
**Created:** [12 December 2022 05:55 UTC](https://discourse.nodered.org/t/persistence-storage-using-aws-efs/72051 "2022-12-12T05:55:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![khadseg](https://avatars.discourse-cdn.com/v4/letter/k/fbc32d/32.png) [@khadseg](https://discourse.nodered.org/u/khadseg)\
**Post date:** [12 December 2022 05:55 UTC](https://discourse.nodered.org/t/persistence-storage-using-aws-efs/72051/1 "2022-12-12T05:55:51Z")

</div>

Hi Team,  
I have setup NodeRed on AWS on my test environment.  
Below are my architecture details :

1. I am using ECS fargate to host the docker image.
2. I have configured the persistent storage using EFS.
3. Dockerfile consists this :  
FROM nodered/node-red:latest
4. Deployment is done through Azure Devops pipeline using Terraform scripts.

I was facing some issues with permissions while implementing persistent storage on EFS, which I fixed by using following wiki article :

> **[Permissions and Persistence · node-red/node-red-docker Wiki](https://github.com/node-red/node-red-docker/wiki/Permissions-and-Persistence)**
>
> Repository for all things Node-RED and Docker related - Permissions and Persistence · node-red/node-red-docker Wiki

Though I could manage setup persistence storage, I still have some doubts :  
When I ran the following command : ```  
` ls -nal /home/ubuntu/node-red`  
Expected output was :

```auto
      drwxrwxr-x 3 1000 100 4096 Oct 2 12:02 .
      drwxrwxr-x 3 1000 100 4096 Oct 2 09:25 ..
     drwxr-xr-x 3 1000 1000 4096 Oct 2 10:23 data

```

But what I get is :

```auto
   drwxr-xr-x 3 0 0 18 Dec 12 04:47 .
  drwxr-xr-x 3 0 0 22 Dec 12 04:47 ..
  drwxr-xr-x 2 0 0 6 Dec 12 04:47 data

```

Also : when I check root user using "id $USER"  
instead of getting root user as 1000, I get -\> uid=0(root) gid=0(root) groups=0(root)

So I fixed it by doing following :  
I changed my aws task definition to use the user option to override the default userid to '0'. It looks like below now :

```auto
     "name": "nodered-image",
    "image": "${container_image}",
    "user": "0:0",
    "restart": "always",
    "essential": true,

```

So can someone help me understand following things :

1. Why I am getting root user as 0 instead of 1000 ?
2. Is overriding using "user": "0:0" is right way to fix the issue? or is their any other better way ?
3. I am using latest image to create container. Is it a right way or should I be using specific stable version instead?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 February 2023 05:56 UTC](https://discourse.nodered.org/t/persistence-storage-using-aws-efs/72051/2 "2023-02-10T05:56:23Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
