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.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南