I have a Cognito user pool in Pulumi and I need to reference its region in another resource. How does one get the region for a resource in Pulumi?
The AWS provider doesn't allow defining the region per each resource. Instead, region is a property of the provider itself.
If you use the default ambient provider, then the region is in aws.config.region:
const user = new aws.cognito.UserPool("up", { ... });
export const region = aws.config.region;
If you use an explicit provider, the region is defined by its options:
const myProvider = new aws.Provider("my-provider", {
region: "eu-north-1",
});
const user = new aws.cognito.UserPool("up", { ... }, { provider: myProvider });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With