This message was deleted.
# general
s
This message was deleted.
👍 1
w
This is a very good question, and something we’ve discussed quite a lot. There are indeed many benefits to making providers explicit. We will likely add a flag to allow turning off the default provider either per package or globally for all packages. In the meantime, a pattern I have used is to set an invalid value for a stack setting (like
aws:region
) which will ensure all resources that are created with the default provider will fail. This indeed does require a per-stack setting though. https://github.com/pulumi/pulumi/issues/2059 is related and/or the same depending on which approach we take to address this.
👍 1
r
Thanks for this clarification! This is definitely something that should be a built-in feature to switch to explicit providers. For Kubernetes (where I definitely want to create the provider based on some
StackReference
output, this already works fine by setting
pulumi config set kubernetes:context invalid-context-disabling-default-provider
that gives a good error message if there is a resource not using an explicit provider. Would you recommend to also use explicit providers for the cloud providers? In the beginning (e.g. working with just one Azure subscription, using explicit providers seems like too much effort as the error will not happen when
clientId
,
clientSecret
,
tenantId
, … are defined for the stack. This only gets problematic as soon as a second, explicit provider (e.g. to control global dns) is introduced, which then would mean to switch everything to explicit configuration. So I’d still like to see some flag at that point in time that allows to disable the default provider to avoid an accidental use of it.
Concerning that latest case. Is there a best practice to create scoped/nested configs that basically match the default
azure:clientId
notation so one can leverage creating a provider by just passing a full config object (mirroring all the same keys that exist under
azure
)?