core: provider alias inheritance

An aliased provider should not be automatically inherited, nor
implicitly instantiated in a module. This test should not have
previously passed.

Add a proxy provider block to the module and update the provider to
match the schema.
This commit is contained in:
James Bardin 2018-05-30 21:47:33 -04:00 committed by Martin Atkins
parent 46ba98233a
commit 65cd163365
3 changed files with 6 additions and 2 deletions

View File

@ -2536,7 +2536,7 @@ func TestContext2Apply_moduleInheritAlias(t *testing.T) {
p.DiffFn = testDiffFn
p.ConfigureFn = func(c *ResourceConfig) error {
if _, ok := c.Get("child"); !ok {
if _, ok := c.Get("value"); !ok {
return nil
}

View File

@ -1,3 +1,7 @@
provider "aws" {
alias = "eu"
}
resource "aws_instance" "foo" {
provider = "aws.eu"
}

View File

@ -3,7 +3,7 @@ provider "aws" {
}
provider "aws" {
child = "eu"
value = "eu"
alias = "eu"
}