https://pulumi.com logo
#getting-started
Title
# getting-started
g

gorgeous-rose-37776

08/27/2023, 9:17 AM
Hi I am new to Pulumi. I am looking for way to load a config value from the command line at run time, in my case it's my gcp project id, something like
pulumi up --config key:value
, if something like this exists. For now i am just loading an env variable in my python script, but i get this warning
Copy code
warning: unable to detect a global setting for GCP Project;
    Pulumi will rely on per-resource settings for this operation.
    Set the GCP Project by using:
    	`pulumi config set gcp:project <project>`
What's the best way to do this?
s

salmon-account-74572

08/28/2023, 2:42 PM
Take a look at
pulumi.Config()
and the
get
function to retrieve values from a stack configuration: https://www.pulumi.com/docs/reference/pkg/python/pulumi/#configuration-and-metadata-1