I'm getting an odd error when trying to run `pulum...
# general
t
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
Try
pulumi config set aws:region us-east-1
t
I still receive the error
error: Missing required configuration variable 'poc-pulumi:aws:region
on running
pulumi up
after doing so.
h
Huh..not sure then. I always use that command to set my aws region for a new project
g
@thankful-hospital-94793 are you using pulumi config explicitly anywhere in your code? e.g.
config.requre("aws:config")
t
Good catch; I definitely am.
I see how that could break it, now.
Is there a way to do that properly?
h
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
Oh, good stuff; that should do it!
h
@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