-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16619 from hashicorp/jbardin/implicit-providers
Allow overriding an implicitly used provider
- Loading branch information
Showing
6 changed files
with
141 additions
and
40 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
terraform/test-fixtures/transform-provider-implicit-module/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,10 @@ | ||
provider "aws" { | ||
alias = "foo" | ||
} | ||
|
||
module "mod" { | ||
source = "./mod" | ||
providers = { | ||
"aws" = "aws.foo" | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
terraform/test-fixtures/transform-provider-implicit-module/mod/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,2 @@ | ||
resource "aws_instance" "bar" { | ||
} |
11 changes: 11 additions & 0 deletions
11
terraform/test-fixtures/transform-provider-invalid/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,11 @@ | ||
provider "aws" { | ||
} | ||
|
||
module "mod" { | ||
source = "./mod" | ||
|
||
# aws.foo doesn't exist, and should report an error | ||
providers = { | ||
"aws" = "aws.foo" | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
terraform/test-fixtures/transform-provider-invalid/mod/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,2 @@ | ||
resource "aws_resource" "foo" { | ||
} |
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
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