https://pulumi.com logo
t

thankful-hospital-94793

12/23/2019, 6:29 PM
I'm getting an odd error when trying to run `pulumi up`:
error: Missing required configuration variable 'poc-pulumi:aws:region'
. When I do what the error describes and set:
pulumi config set poc-pulumi:aws:region us-east-1
, I get another error telling me the format is invalid: `error: invalid configuration key: could not parse poc-pulumiawsregion as a configuration key (configuration keys should be of the form
<namespace>:<name>
)`
h

handsome-actor-1155

12/23/2019, 6:30 PM
Try
pulumi config set aws:region us-east-1
t

thankful-hospital-94793

12/23/2019, 6:32 PM
I still receive the error
error: Missing required configuration variable 'poc-pulumi:aws:region
on running
pulumi up
after doing so.
h

handsome-actor-1155

12/23/2019, 6:34 PM
Huh..not sure then. I always use that command to set my aws region for a new project
g

gentle-diamond-70147

12/23/2019, 6:49 PM
@thankful-hospital-94793 are you using pulumi config explicitly anywhere in your code? e.g.
config.requre("aws:config")
t

thankful-hospital-94793

12/23/2019, 6:50 PM
Good catch; I definitely am.
I see how that could break it, now.
Is there a way to do that properly?
h

handsome-actor-1155

12/23/2019, 7:07 PM
I just had to do this. import the Pulumi aws package then use aws.config.region
👍 1
I did not see a way to get it directly from the yaml config
t

thankful-hospital-94793

12/23/2019, 7:14 PM
Oh, good stuff; that should do it!
h

handsome-actor-1155

01/28/2020, 4:54 AM
@thankful-hospital-94793 I found a better solution! After RTFM…lol I found you can do this:
Copy code
const awsConfig = new pulumi.Config("aws");
console.log(awsConfig.require("region"));
This gets the
aws
section of your
Pulumi.dev.yaml
file :)
👍 1