Merge pull request #25408 from hashicorp/alisdair/fix-panic-provider-alias
configs: Fail early for invalid resource provider
This commit is contained in:
commit
7190ef571e
|
@ -422,6 +422,9 @@ func decodeProviderConfigRef(expr hcl.Expression, argName string) (*ProviderConf
|
||||||
name := traversal.RootName()
|
name := traversal.RootName()
|
||||||
nameDiags := checkProviderNameNormalized(name, traversal[0].SourceRange())
|
nameDiags := checkProviderNameNormalized(name, traversal[0].SourceRange())
|
||||||
diags = append(diags, nameDiags...)
|
diags = append(diags, nameDiags...)
|
||||||
|
if diags.HasErrors() {
|
||||||
|
return nil, diags
|
||||||
|
}
|
||||||
|
|
||||||
ret := &ProviderConfigRef{
|
ret := &ProviderConfigRef{
|
||||||
Name: name,
|
Name: name,
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
data "test_resource" "t" {
|
||||||
|
provider = my_test
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
resource "test_resource" "t" {
|
||||||
|
provider = my_test
|
||||||
|
}
|
Loading…
Reference in New Issue