Given a stack that has aws defaults set ```config:...
# aws
s
Given a stack that has aws defaults set
Copy code
config:
  aws:region: us-gov-east-1
  aws:profile: ogov-core-services
Is there a way to reference the default ResourceOptions or InvokeOptions this would create via a variable without having to define an entirely new ResourceOptions variable? Or maybe just be able to reference the default provider?
s
aws.config.region
will get you the default provider region. Or, you can access like this:
Copy code
const config = new pulumi.Config("aws");
const defaultRegion = config.get("region"); // config.require() if it has to be there.
s
I think what I'm looking for is this option to disable the default provider entirely and then I'll just use the same config points from the config file to create a custom provider and then refer to it as a variable.
Copy code
pulumi:disable-default-providers:
- aws
s
Yes - if you never want to use the system config so that you accidentally deploy to the wrong account or region, that's a good way to ensure that outcome.
h
I disable the default providers like you mention. In my core account, I create new accounts for our tenants and then I use this code to get a provider to use for tenant stacks.