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
gefragt vor einem Monat106 Aufrufe
1 Antwort
0
Akzeptierte Antwort

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
EXPERTE
beantwortet vor einem Monat
profile pictureAWS
EXPERTE
Greg_B
überprüft vor einem Monat
  • 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.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen