How do I get the value for `aws:profile` instead o...
# aws
g
How do I get the value for
aws:profile
instead of having pulumi look for
project:aws:profile
?
m
Copy code
aws.config.profile
g
I ended up doing
Copy code
const awsConfig = new pulumi.Config("aws");
const profile = awsConfig.require("profile");
Instead
but that makes a lot of sense
m
Sure, that works
g
I’ll bikeshed myself after I have the entire jigsaw complete, thanks for the alt path that’ll now stick at the back of my mind for the next year though
m
This is what I've started to do now:
Copy code
const awsUsEast1Provider = new aws.Provider("us-east-1", {
  ...aws.config,
  region: "us-east-1",
});
There is also an argument to be made for always declaring explicit providers, and not using the default configuration.
g
That’s exactly what I was looking for 😭 For sure but since every stack we have has at the very least
aws:profile
and
aws:region
the expectation is that
aws.config
should exist. I’m probably going to update the code now since I prefer to refer to other stacks for other config items but for stuff like aws I’d rather just use the libs
.config
variable.
s
As a safeguard, you can allowlist certain account IDs in the provider config (which is per-stack). See `allowedAccountIds`: https://www.pulumi.com/registry/packages/aws/installation-configuration/#configuration-options