Are there any excluded environment variables in Greengrass component recipes?

0

I'm trying to set up environment variables in a Greengrass component recipe. My Setenv section looks like:

 "Setenv": {
      "PYTHONPATH": "{artifacts:decompressedPath}",
      "GG_ROOT_PATH": "{kernel:rootPath}",
       ... more env vars
}

GG_ROOT_PATH and my other env vars get set correctly, but PYTHONPATH doesn't, no matter where I place it in the list of variables.

Is there some internal restriction using some names for environment variables?

bruce
asked a month ago98 views
1 Answer
0
Accepted Answer

Hi,

This is done by sudo on your system. You can configure sudo to stop resetting environment, or you can set the environment on the command line directly as such: PYTHONPATH=<my path> python3 <rest of your command here>

Cheers,

Michael

AWS
EXPERT
answered a month ago
profile pictureAWS
EXPERT
Greg_B
reviewed a month ago
  • Okay thanks for the info - makes sense now that I've looked up how sudo behaves for environment variables. But that seems like a bug in how Greengrass uses sudo then - I ask for it to set a specific environment variable and it just goes poof. So if I ever wanted to override an existing environment variable using Setenv I can't do it, and that's not mentioned anywhere in the docs.

  • Thank you for the feedback, unfortunately we are not able to change the way that sudo behaves however we can certainly document this behavior.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions