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

preguntada hace 4 meses156 visualizaciones
1 Respuesta
0
Respuesta aceptada

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
respondido hace 4 meses
  • Thank you, it works indeed.

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas