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

bright-receptionist-28471

03/29/2022, 9:18 PM
Is it possible to get config values from a default provider? I want to get the default project assigned to the GCP default provider. To work around I can add another config key for project, but it seems strange to have both
gcp:project
and
<namespace>:project
set in config
p

prehistoric-activity-61023

03/29/2022, 9:24 PM
If itโ€™s already available in the config, you can easily read the values from another namespace.
Config
constructor takes an additional parameter - you can specify the namespace there
b

bright-receptionist-28471

03/29/2022, 9:25 PM
Oh! Thanks for the pointer! I was looking for exactly that ๐Ÿ™‚
p

prehistoric-activity-61023

03/29/2022, 9:26 PM
Copy code
gcp_config = pulumi.Config("gcp")
gcp_project = gcp_config.require("project")
something like that ๐Ÿ™‚
b

bright-receptionist-28471

03/29/2022, 9:27 PM
yup works like a charm, thanks again
3 Views