I'm probably missing something simple, but I'm run...
# general
I'm probably missing something simple, but I'm running a GCP project and I need to get the value of gcp:project, is there a simple way of getting it without redefining it?
Is that stored in Pulumi Config?
It is as gcp:project, adjacent to gcp:region, gcp:zone, and gcp:credentials
when I try to access it via config.get/require it's outside of the project scope
i.e. where my config settings are module:var when I call for gcp:project it attempts to lookup modulegcpproject
Isn’t all that just stored in an environment variable?
not that I'm aware of, the gcloud tool reads it out of config with an environment overwrite I believe
pulumi stack create prompts for those values just fyi, and in my case I work with multiple projects so the configured for the stack needs to be authoritative
I might be setup differently. I have a
env var. And that’s a json string.
Have you tried to retrieve it with the config library?
I have, and as mentioned it's scoped wrong
so the config is gcp:project
when I use config it attempts to read modulegcpproject
i.e. clustergcpproject which doesn't exist
The easiest way is:
Copy code
That reads the resolved value of the configuration setting. You can also read the config setting directly via:
Copy code
const config = new pulumi.Config("gcp");
👍 1