I use serverless framework and I have multilple aws node.js lambdas that share the same layer. I want to define an ENV variable for all of them-is there a way to put that common ENV variable into the layer's serverless.yml? Or do I have to go and put it in each serverles.yml files separately?
To deal with env variables in my lambdas i use this plugin https://www.npmjs.com/package/serverless-dotenv-plugin
It looks for a .env file use it as a reference to your env variables.
plugins:
- serverless-dotenv-plugin
Hope it helps.