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
질문됨 한 달 전106회 조회
1개 답변
0
수락된 답변

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
전문가
답변함 한 달 전
profile pictureAWS
전문가
Greg_B
검토됨 한 달 전
  • 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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠