https://pulumi.com logo
#aws
Title
# aws
c

cuddly-smartphone-15267

09/08/2021, 12:15 PM
Anybody know if there's a way to query the aws:region that is set in the yaml file? for example if my yaml file looks like:
Copy code
config:
  aws:region: ap-southeast-2
  aws:profile: prod
  shared:stackConfig:
    regionCode: au
is there a way I can do something like (typescript code)
Copy code
const config = new Config();
const awsRegion = config.require("aws:region");
When i try to execute the above, i get an error:
error: Missing required configuration variable 'shared:aws:region'
worked it out..
const awsRegion = new Config("aws").require("region");
b

brave-planet-10645

09/08/2021, 12:44 PM
That's correct. We namespace the config, so region is under the "aws" namespace. If you do
const config = new Config();
then it defaults to the namespace matching the name of the project
👍 1
c

cuddly-smartphone-15267

09/08/2021, 1:18 PM
thanks for confirming @brave-planet-10645