diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index dfe0c883f..f3680ba55 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -5434,7 +5434,7 @@ func TestContext2Apply_provisionerResourceRef(t *testing.T) { pr := testProvisioner() pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error { - val, ok := c.Config["foo"] + val, ok := c.Config["command"] if !ok || val != "2" { t.Fatalf("bad value for foo: %v %#v", val, c) } @@ -8979,7 +8979,7 @@ func TestContext2Apply_ignoreChangesWithDep(t *testing.T) { }, }, "aws_eip.foo.0": &ResourceState{ - Type: "aws_instance", + Type: "aws_eip", Primary: &InstanceState{ ID: "eip-abc123", Attributes: map[string]string{ @@ -8989,7 +8989,7 @@ func TestContext2Apply_ignoreChangesWithDep(t *testing.T) { }, }, "aws_eip.foo.1": &ResourceState{ - Type: "aws_instance", + Type: "aws_eip", Primary: &InstanceState{ ID: "eip-bcd234", Attributes: map[string]string{ @@ -9012,10 +9012,8 @@ func TestContext2Apply_ignoreChangesWithDep(t *testing.T) { State: s, }) - if p, diags := ctx.Plan(); diags.HasErrors() { + if _, diags := ctx.Plan(); diags.HasErrors() { t.Fatalf("diags: %s", diags.Err()) - } else { - t.Logf(p.String()) } state, diags := ctx.Apply() @@ -9026,7 +9024,7 @@ func TestContext2Apply_ignoreChangesWithDep(t *testing.T) { actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(s.String()) if actual != expected { - t.Fatalf("bad: \n%s", actual) + t.Fatalf("expected:\n%s\n\ngot:\n%s", expected, actual) } } diff --git a/terraform/context_plan_test.go b/terraform/context_plan_test.go index d7c3df631..55fc0313a 100644 --- a/terraform/context_plan_test.go +++ b/terraform/context_plan_test.go @@ -2603,7 +2603,7 @@ func TestContext2Plan_taint(t *testing.T) { } } -func TestContext2Apply_taintIgnoreChanges(t *testing.T) { +func TestContext2Plan_taintIgnoreChanges(t *testing.T) { m := testModule(t, "plan-taint-ignore-changes") p := testProvider("aws") p.ApplyFn = testApplyFn diff --git a/terraform/test-fixtures/apply-depends-create-before/main.tf b/terraform/test-fixtures/apply-depends-create-before/main.tf index b4666f5bc..89436a000 100644 --- a/terraform/test-fixtures/apply-depends-create-before/main.tf +++ b/terraform/test-fixtures/apply-depends-create-before/main.tf @@ -1,4 +1,3 @@ - resource "aws_instance" "web" { require_new = "ami-new" lifecycle { diff --git a/terraform/test-fixtures/apply-ignore-changes-dep/main.tf b/terraform/test-fixtures/apply-ignore-changes-dep/main.tf index 301d2da27..097d48942 100644 --- a/terraform/test-fixtures/apply-ignore-changes-dep/main.tf +++ b/terraform/test-fixtures/apply-ignore-changes-dep/main.tf @@ -8,5 +8,5 @@ resource "aws_instance" "foo" { resource "aws_eip" "foo" { count = 2 - instance = "${element(aws_instance.foo.*.id, count.index)}" + instance = "${aws_instance.foo.*.id[count.index]}" }