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
feita há um mês106 visualizações
1 Resposta
0
Resposta aceita

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
ESPECIALISTA
respondido há um mês
profile pictureAWS
ESPECIALISTA
Greg_B
avaliado há um mês
  • 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.

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas