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

gorgeous-lunch-7514

09/05/2023, 3:20 PM
How do I get the value for
aws:profile
instead of having pulumi look for
project:aws:profile
?
m

millions-furniture-75402

09/05/2023, 3:52 PM
Copy code
aws.config.profile
g

gorgeous-lunch-7514

09/05/2023, 3:53 PM
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

millions-furniture-75402

09/05/2023, 3:53 PM
Sure, that works
g

gorgeous-lunch-7514

09/05/2023, 3:54 PM
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

millions-furniture-75402

09/05/2023, 3:56 PM
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

gorgeous-lunch-7514

09/05/2023, 4:01 PM
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

stocky-restaurant-98004

09/05/2023, 9:35 PM
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