https://pulumi.com logo
Title
t

thousands-camera-45384

04/09/2021, 1:29 PM
anyone knows how to get provider related configuration from code (basically from another namespace)? (for example gcp project)
b

broad-dog-22463

04/09/2021, 1:55 PM
gcp.config.project should do it
its in the config namespace
t

thousands-camera-45384

04/09/2021, 2:01 PM
in any case it automatically adds full_key with a project_name prefix, so it becomes: project_name:gcp.config.project
b

broad-dog-22463

04/09/2021, 2:21 PM
what language are you using?
t

thousands-camera-45384

04/09/2021, 2:23 PM
using python and trying for example: config.require('gcp.config.project') config.require('gcp.project') config.require('gcp:project') but in all cases result is the same
b

broad-dog-22463

04/09/2021, 4:07 PM
you need to load the config of the "gcp" namespace
and then it will give you access to this
config = pulumi.Config() project = config.get('project')
so like that
notice no need for
gcp:
t

thousands-camera-45384

04/09/2021, 4:12 PM
yep, tried this way as well, but still: error: Missing required configuration variable 'project_name:project'
b

broad-dog-22463

04/09/2021, 4:18 PM
that's kinda different
what does your Pulumi.<stack>.yaml file look like? (please remove sensitive info)
t

thousands-camera-45384

04/09/2021, 5:30 PM
encryptionsalt: .... config: gcp😛roject: project_name gcp:region: region_name [and some other stack specific vars]