diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index 48289957ad..6f6d02b36d 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -2432,55 +2432,6 @@ func TestContext2Apply_provisionerInterpCount(t *testing.T) { } } -func TestContext2Apply_mapVariableOverride(t *testing.T) { - m := testModule(t, "apply-map-var-override") - p := testProvider("aws") - p.ApplyFn = testApplyFn - p.DiffFn = testDiffFn - ctx := testContext2(t, &ContextOpts{ - Config: m, - ProviderResolver: ResourceProviderResolverFixed( - map[string]ResourceProviderFactory{ - "aws": testProviderFuncFixed(p), - }, - ), - Variables: InputValues{ - "images": &InputValue{ - Value: cty.MapVal(map[string]cty.Value{ - "us-west-2": cty.StringVal("overridden"), - }), - SourceType: ValueFromCaller, - }, - }, - }) - - if _, diags := ctx.Plan(); diags.HasErrors() { - t.Fatalf("diags: %s", diags.Err()) - } - - state, diags := ctx.Apply() - if diags.HasErrors() { - t.Fatalf("diags: %s", diags.Err()) - } - - actual := strings.TrimSpace(state.String()) - expected := strings.TrimSpace(` -aws_instance.bar: - ID = foo - provider = provider.aws - ami = overridden - type = aws_instance -aws_instance.foo: - ID = foo - provider = provider.aws - ami = image-1234 - type = aws_instance - `) - if actual != expected { - t.Fatalf("got: \n%s\nexpected: \n%s", actual, expected) - } -} - func TestContext2Apply_moduleBasic(t *testing.T) { m := testModule(t, "apply-module") p := testProvider("aws") diff --git a/terraform/test-fixtures/apply-map-var-override/main.tf b/terraform/test-fixtures/apply-map-var-override/main.tf deleted file mode 100644 index bd0fadcaa0..0000000000 --- a/terraform/test-fixtures/apply-map-var-override/main.tf +++ /dev/null @@ -1,14 +0,0 @@ -variable "images" { - default = { - us-east-1 = "image-1234" - us-west-2 = "image-4567" - } -} - -resource "aws_instance" "foo" { - ami = "${lookup(var.images, "us-east-1")}" -} - -resource "aws_instance" "bar" { - ami = "${lookup(var.images, "us-west-2")}" -}