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
質問済み 1ヶ月前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
エキスパート
回答済み 1ヶ月前
profile pictureAWS
エキスパート
Greg_B
レビュー済み 1ヶ月前
  • 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.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ