Merge environment variables for lambda component in Greengrass v2 deployment configuration

0

Hello, I'm reading about creating Greengrass v2 deployments and using merge updates.

The configuration of my lambda component looks something like that and works well. { "lambdaFunction": { ... "componentLambdaParameters": { ... "environmentVariables": { "VAR_1": "value 1", "VAR_2": "value 2" } } } }

In my case I want to merge update environment variables during deployment for my component e.g. "VAR_2": "new value 2"

In my deployment config I'm trying something like below but doesn't work: ... "configurationUpdate": { "merge": "{"environmentVariables":{"VAR_2":"new value 2"}}" }

Could you please help?

  • When you set Lambda environment variables from the CLI it overwrites what was there. I don't know how Greengrass works, but you may need to set all the variables (new and existing).

質問済み 4ヶ月前156ビュー
1回答
0
承認された回答

Hi, To update the environment variable for lambda components is different with creating lambda components, the correct way is to merge

"lambdaExecutionParameters": {
    "EnvironmentVariables": {
      "VAR_2": "new value 2"
    }
  },

lambdaExecutionParameters and EnvironmentVariables are shown in the component recipe

AWS
yitingb
回答済み 4ヶ月前
  • Thank you, it works indeed.

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

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

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

関連するコンテンツ