From 65cd16336520a3d9f99bd1e0fe3c0f59ba882297 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 30 May 2018 21:47:33 -0400 Subject: [PATCH] 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. --- terraform/context_apply_test.go | 2 +- .../apply-module-provider-inherit-alias/child/main.tf | 4 ++++ .../test-fixtures/apply-module-provider-inherit-alias/main.tf | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index 5fb2fc161..cf40c8fee 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -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 } diff --git a/terraform/test-fixtures/apply-module-provider-inherit-alias/child/main.tf b/terraform/test-fixtures/apply-module-provider-inherit-alias/child/main.tf index d05e148a5..2db7c4ee8 100644 --- a/terraform/test-fixtures/apply-module-provider-inherit-alias/child/main.tf +++ b/terraform/test-fixtures/apply-module-provider-inherit-alias/child/main.tf @@ -1,3 +1,7 @@ +provider "aws" { + alias = "eu" +} + resource "aws_instance" "foo" { provider = "aws.eu" } diff --git a/terraform/test-fixtures/apply-module-provider-inherit-alias/main.tf b/terraform/test-fixtures/apply-module-provider-inherit-alias/main.tf index 0db824347..a018d1468 100644 --- a/terraform/test-fixtures/apply-module-provider-inherit-alias/main.tf +++ b/terraform/test-fixtures/apply-module-provider-inherit-alias/main.tf @@ -3,7 +3,7 @@ provider "aws" { } provider "aws" { - child = "eu" + value = "eu" alias = "eu" }