-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set different/separated env vars per function? #35
Comments
It's a very good question. I didn't find any possibility to set this with the usage of this library that's why I decided to create my own @colynb is it possible to do this via your library? |
Would you mind describing a use-case/scenario so that I can get a better understanding? Thanks |
@colynb Yes, of course, and I believe that it will be a simple example 😉
With the current functionality, we will get |
I'm having a similar use case: I want to load env variables in my fargate task definition, but not in my lambda functions. custom:
dotenv:
include: [] # Do not inject env variables into lambdas Having an option to disable auto injection could be great by the way :) |
Hello everyone, I have additional questions about this scenario: Assuming there are 10 env vars declared in
will |
Hi, any updates on this?
This will definitely be very helpful |
@krlozadan sorry for the VERY late response. I've been using today to get caught up on this plugin. As I mentioned in a few other issues here recently, I'm extremely nervous about accidentally introducing breaking changes so I erred on the side of simply ignoring these requests. With that said, this is definitely one of the trickier requests to implement. I'm not sure how I would even approach it. |
I am 90+% sure of the following. Please test my statements below if you would like to be 100% sure. Environment variables defined with serverless-dotenv-plugin/index.js Lines 120 to 122 in 2b66c15
In your example, Furthermore, environment variables with the same name defined at the function name takes precedence over ones defined at a project level. This means |
This is my recommendation as well. Please see #89 for details. |
I think all questions have been answered. Because there are a variety of questions here, if you have a follow-up question or a related question, please post it in https://github.com/neverendingqs/serverless-dotenv-plugin/discussions/categories/q-a. Thanks! |
Hello,
Thank you for creating an amazing useful library.
Can I set some vars only for one(or more) functions in a project?
Thanks.
The text was updated successfully, but these errors were encountered: