dcb8b45e0f
Previously, resources without explicit provider configuration (i.e. a `provider =` attribute) would be assigned a default provider based upon the resource type. For example, a resource `foo_bar` would be assigned provider `hashicorp/foo`. This behaviour did not work well with community or partner providers, with sources configured in `terraform.required_providers` blocks. With the following configuration: terraform { required_providers { foo = { source = "acme/foo" } } } resource foo_bar "a" { } the resource would be configured with the `hashicorp/foo` provider. This commit fixes this implied provider behaviour. First we look for a provider with local name matching the resource type in the module's required providers map. If one is found, this provider is assigned to the resource. Otherwise, we still fall back to a default provider. |
||
---|---|---|
.. | ||
config-build | ||
dir-empty | ||
error-files | ||
experiments | ||
invalid-files | ||
invalid-modules | ||
nested-errors | ||
provider-reqs | ||
providers-explicit-fqn | ||
valid-files | ||
valid-modules | ||
warning-files |