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).

gefragt vor 4 Monaten156 Aufrufe
1 Antwort
0
Akzeptierte Antwort

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
beantwortet vor 4 Monaten
  • Thank you, it works indeed.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen