-
Notifications
You must be signed in to change notification settings - Fork 127
Environment variables are not supported #92
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
Comments
As far as I can tell Google's Cloud Functions don't support environment variables. Google's API documentation for Functions doesn't seem to make any reference to them. I haven't tried it, but you may be able to use the dotenv npm package along with including a I've also seen where people added build steps to create files to include instead of using environment variables. This is an article that I have seen written on the subject. |
I mean how far away is this feature?? :( |
I was not able to make it work with dotenv npm package. I've installed serverless-dotenv-plugin which from the documentation looks more optimized for AWS rather than for Google Cloud. Totally a workaround which shouldn't be use in any production code. Too bad this feature is not yet available... |
+1 would love to see this feature |
It looks like environment variables are a beta feature in Google's API now, so adding this feature shouldn't be too hard. It would be very similar to how I added labels (#95) |
I created a pull request that adds environment variables 2 weeks ago: #117 |
Need this feature |
You can use my pull request (#117) for now, I've been using it for 2 months with no problems. |
@nethunter How can I use it? |
@mrdulin replace your serverless-cloud-functions line in package.json with this:
and then in serverless.yml, under your provider add "environment" and add all the environment variables you want |
@nethunter thanks. It works. I made a sample for passing environment variables:
https://github.com/mrdulin/nodejs-serverless-framework/tree/master |
Now that #117 is merged, this can be closed. |
Thanks for opening @blackxored and thanks for updating @pickypg 👍 The latest version of this plugin supports env vars. Closing... |
Where's the docs? |
@pmuens How can environment variables added via serverless.yml be used within cloud functions ? |
Nevermind it's the same as aws config. Can this be updated in the google cloud docs? Maybe a general section on general valid config options that works for every provider. |
Environment vars (through
environment
under bothprovider
and in the actual function declaration inserverless.yml
doesn't seem to be supported. Furthermore, there isn't even a warning about it. As someone pretty much forced to deploy something on GCF as opposed to AWS Lamda this is rather confusing and an obvious feature to have. Is there somewhere I can find documentation about this?The text was updated successfully, but these errors were encountered: