opentofu/terraform/testdata/validate-required-provider-config/main.tf
Kristin Laemmert 57fd4c34d1 terraform: fix ProviderConfigTransformer
The ProviderConfigTransformer was using only the provider FQN to attach
a provider configuration to the provider, but what it needs to do is
find the local name for the given provider FQN (which may not match the
type name) and use that when searching for matching provider
configuration.

Fixes #26556

This will also be backported to the v0.13 branch.
2020-10-13 10:07:25 -04:00

21 lines
492 B
HCL

# This test verifies that the provider local name, local config and fqn map
# together properly when the local name does not match the type.
terraform {
required_providers {
arbitrary = {
source = "hashicorp/aws"
}
}
}
# hashicorp/test has required provider config attributes. This "arbitrary"
# provider configuration block should map to hashicorp/test.
provider "arbitrary" {
required_attribute = "bloop"
}
resource "aws_instance" "test" {
provider = "arbitrary"
}