-
Notifications
You must be signed in to change notification settings - Fork 416
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
Make webpack aware of stage/region #86
Comments
I've posted my workaround for this issue here. |
There have been vast improvements made in Serverless in the last few versions, especially for the variable system. E.g. it is now possible to have variables stored externally (S3) because the variable system has been been switched to asynchronous retrieval. Even CF output variables can be referenced and imported into variables now. With this in mind, does the issue mentioned here still persist? |
It still does unfortunately, although I'm not sure whether |
We even use |
@HyperBrain How do you load the generated |
The export-env plugin sets the environment variables defined for your lambdas correctly when you use serverless-offline. That's the only way we use to get them set. Maybe @arabold can provide some details for his plugin. |
@Spaider I fail to see how an external The |
Sorry guys, it was so long ago, I had been drawn to other projects already. Not sure if I will have time to check this soon. |
@Spaider No problem. It was serverless-webpack that fell asleep like Sleeping Beauty for quite a long time 😃 so it's not your fault. But we kissed it alive again. |
I need a fresh look at my problem. I am using serverless 1.x and want to deploy to different regions with different stages (surprise, huh? :) ) Every stage/region has its own set of settings, DB connection options, to be precise.
Everything was more or less good before I decided to introduce webpack plugin: region/stage-specific options were stored in ${region}.${stage}.env files and I load them with dot-env.
It's not possible anymore when I started to use
webpack
plugin. Well, at least solution is avoiding me. The only way to achieve similar functionality is to define all the variables inserverless.yml
file and resolve them indirectly via${opt:stage}
and${opt:region}
variables. I do not like this for two reasons:I am thinking, if stage/region information will be available during webpack'ing phase then it will be possible to dynamically load necessary settings with help of
dotenv-webpack
plugin.May be I am missing something or even trying to approach the problem from the wrong site.
Any ideas will be much appreciated.
Thanks.
The text was updated successfully, but these errors were encountered: