Google Cloud Variable Environment Variables

Is it possible to set environment variables for GCF so that all of these parameters are visible to all functions? Or maybe there are some options for setting it up in the project area?

I just need a parameterization mechanism for all environments, such as local-dev, dev, stage, prod for functions. At the moment, I'm trying to configure a local data warehouse emulator and configure the development / debugging / testing workflow without writing statements inside the code. As I understand it, such things can be configured through env. veriables, but I don’t know how this will work on the target platform in the cloud.

In the future, deployment will be carried out by separation environments for separate cloud projects with their own databases and repositories, as well as env. variables.

Is this possible or is there some kind of solution for something like this?

+6
source share
2 answers

Not to mention that Deployment Manager will not handle them the same way (although I couldn’t pinpoint it), this below seems like the closest answer to what you are talking about:

https://github.com/fredriks/cloud-functions-runtime-config/blob/master/README.md

In addition to this npm package example, it clearly shows gcloud commands to run.

It is important to activate the corresponding api , as explained here (see "before you start")

+4
source

, , , , Runtime Configurator Deployment Manager ? , , .

.

REST API .

0

Source: https://habr.com/ru/post/1016314/


All Articles