3
Problems with lambda versioning:
- I have a lambda function where I use environment variables.
- This function is executed by an endpoint through the Gateway API ( aws )
- I have 3 stages of the same feature ( Gateway Api ): dev, Hom, Prod
- I have to change the lambda environment variable according to the stage that is calling the function.
The problem is that, as all stages call the same lambda function, both stages use the lambda version in producing, in the environment variables I define the connection to the database, I need this connection to change according to the stage that called the function. I tried to versioning the function but I had the problem of not being able to change the environment variable in the version, it is only possible to change in the master.
Follows explanatory images of the problem.
Wouldn’t it be the case to use three lambda functions, each with its own defined environment variables? You have the advantage ai to evolve your code without impacting the function running in production
– gmsantos