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

posta 4 mesi fa156 visualizzazioni
1 Risposta
0
Risposta accettata

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
con risposta 4 mesi fa
  • Thank you, it works indeed.

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande