Compatility with Serverless Framework 3.0.0+ #155
Replies: 5 comments 1 reply
-
I am also thinking of holding off on v4 of this plugin, even though it introduces safer defaults. You can still use them by setting Alternatively, I might release v4, but leave |
Beta Was this translation helpful? Give feedback.
-
@neverendingqs great thanks for those comments, and all the insight! Below I share my view as of Serverless Framework maintainer:
Technically those variables are now automatically injected into environment by the Framework (assuming The difference here is, that Framework has different rules towards resolving dotenv files specific to given environment. In Framework either In general Framework support for
When this plugin is concerned, I would probably focus on configuration of environment variables for lambdas, as that Framework doesn't provide, and leave loading of environment variables into the process to the Framework Plugin via some configuration option could take name of env variables to load for lambdas. Still if it'll be just about that, the more accurate name for the plugin would be: As a side note, technically plugin will be able to work the way it worked, once support for extensions is introduced, as extensions will be loaded at very early phase (before configuration and variables are resolved). Still once support for |
Beta Was this translation helpful? Give feedback.
-
Is there any thought to be able to pass in a list via ${env:} variable in my env file so I am not having to define many env variables. Example for something like audiences on an API Gateway:
And then in my
|
Beta Was this translation helpful? Give feedback.
-
@neverendingqs we've actually decided (internally) to revert from deprecation notice, and in v3 we will keep very same behavior as it's in v2 ( The reasoning is that we're worried to break for users which already use PR that removes the deprecation in v2 will be introduced in next days |
Beta Was this translation helpful? Give feedback.
-
Following the update above, here is a proposal to update the README: #183 |
Beta Was this translation helpful? Give feedback.
-
As you may know, starting at 3.0.0, the Serverless Framework will resolve all
${env:}
variables before any plugins are created due to a revamp of their variables engine. This means this plugin will no longer be able to inject environment variables into the Serverless environment to be used inside any Serverless YAML files, although it conceiveably is still useful for loading environment variables for other plugins. See the FAQ in the README for details.The plugin can continue to load variables inside your
dotenv
files into every function's environment.There is a simple solution for mimicking what this plugin does in Serverless 3.0.0+, as demonstrated in https://github.com/neverendingqs/serverless-dotenv-example.
Questions:
Side note: the new variables engine is already active in Serverless Framework 2.26.0+. However, if it fails to resolve all variables, it will fall back to the previous version of the variables engine, which is why this plugin will continue to mostly work (see FAQ for how 2.26.0+ has affected some things).
Beta Was this translation helpful? Give feedback.
All reactions