You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Provider %s with the local name %q was implicitly required via a configuration block as %q. Make sure the provider configuration block name matches the name used in required_providers.",
121
+
"Provider %s with the local name %q was implicitly required via a configuration block as %q. The provider configuration block name must match the name used in required_providers.",
// Now that we have all the provider configs and requirements validated,
147
+
// check for any resources which use an implied localname which doesn't
148
+
// match that of required_providers
149
+
for_, r:=rangeresourceConfigs {
150
+
// We're looking for resources with no specific provider reference
151
+
ifr.ProviderConfigRef!=nil {
152
+
continue
153
+
}
154
+
155
+
localName:=r.Addr().ImpliedProvider()
156
+
if_, ok:=localNames[localName]; ok {
157
+
// OK, this was listed directly in the required_providers
158
+
continue
159
+
}
160
+
161
+
defAddr:=addrs.NewDefaultProvider(localName)
162
+
163
+
// Now make sure we don't have the same provider required under a
164
+
// different name.
165
+
forprevLocalName, addr:=rangelocalNames {
166
+
ifaddr.Equals(defAddr) {
167
+
diags=append(diags, &hcl.Diagnostic{
168
+
Severity: hcl.DiagWarning,
169
+
Summary: "Duplicate required provider",
170
+
Detail: fmt.Sprintf(
171
+
"Provider %q was implicitly required via resource %q, but listed in required_providers as %q. Either the local name in required_providers must match the resource name, or the provider must be assigned within the resource block.",
0 commit comments