This message was deleted.
# python
s
This message was deleted.
w
There is not currently any concept of “project’s default” configuration in Pulumi. All configuration must be specified on the stack, and default values can be provided in code if needed (which morally accomplishes being a project default - but it is specified in source code not in the project YAML).
b
thank you @white-balloon-205. So I basically have to add additional value in stacks.yaml that will duplicate the gcp:region key? Something like this:
Copy code
config:
  gcp:project: some-project
  gcp:region: europe-west3
  some-project:gcp:region: europe-west3
But when I do
pulumi config set gcp:region europe-west-3
it just sets the same value
Copy code
config:
  gcp:region: europe-west3
@white-balloon-205, can you please comment on this? It seems a bit weird to duplicate values in the config, but if it is the only way now - I will do it of course.
g
you need to load the the config with the "gcp" namespace...
Copy code
gcp_config = pulumi.Config("gcp") # <----

instance = compute.Instance(...,
    zone=gcp_config.require("region"),
)
b
@gentle-diamond-70147 that's amazing! Thank you so much! I can confirm that it works
👍 1
I am sorry, but I didn't realise it was a separate namespace, I am not that efficient with pulumi yet)
g
No need to apologize! I think we should handle this better - log a warning or maybe throw an error if you try to get a config value with
bag:key
. I'm not sure that's valid.