-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
8a4c493
commit 392240a
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
terraform/testdata/validate-required-provider-config/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters