Override nested configuration at run time with node config for aws app runner

25 views Asked by At

I have a node js application deployed in AWS app runner and I use node-config for configurations.

I have following as the default.json

{
    "security" : {
        "jwtSecret": "mylocalsecret"
    }
}

Now I'm trying to override this for the deployment on app runner. As per the documentation I can do following.

NODE_CONFIG='{"secret":{"jwtSecret":"production-secret"}}' node myapp.js 

I want this to pick that value from AWS parameter store. So instead of the value I have a ARN for this. Since App runner set values from parameter store to environmental variable I tried creating the NODE_CONFIG resolving environment variable as the value. It worked locally as following.

NODE_CONFIG="{\"security\":{\"jwtSecret\": \"${JWT_SECRET}\"}}" npm run start

But this doesn't work in app runner. I could found following part error in cloud watch.

runc create failed: unable to start container process: exec: "NODE_CONFIG=\"{\\\"security\\\":{\\\"jwtSecret\\\":": executable file not found in $PATH
  1. Why this work locally and not in app runner? (My local shell is bash may be app runner use something different and hence work differently)
  2. Is there another way to do this?

P.S JWT secret set to environment variable from parameter sore enter image description here

0

There are 0 answers