diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index d32c650ca..f1d527fdc 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -8615,9 +8615,18 @@ func TestContext2Apply_issue7824(t *testing.T) { p.ResourcesReturn = append(p.ResourcesReturn, ResourceType{ Name: "template_file", }) - p.ApplyFn = testApplyFn p.DiffFn = testDiffFn + p.GetSchemaReturn = &ProviderSchema{ + ResourceTypes: map[string]*configschema.Block{ + "template_file": { + Attributes: map[string]*configschema.Attribute{ + "template": {Type: cty.String, Optional: true}, + "__template_requires_new": {Type: cty.Bool, Optional: true}, + }, + }, + }, + } // Apply cleanly step 0 ctx := testContext2(t, &ContextOpts{ diff --git a/terraform/test-fixtures/issue-5254/step-0/main.tf b/terraform/test-fixtures/issue-5254/step-0/main.tf index 717d241a9..dd666eba1 100644 --- a/terraform/test-fixtures/issue-5254/step-0/main.tf +++ b/terraform/test-fixtures/issue-5254/step-0/main.tf @@ -3,7 +3,7 @@ variable "c" { } resource "template_file" "parent" { - count = "${var.c}" + count = var.c template = "Hi" } diff --git a/terraform/test-fixtures/issue-5254/step-1/main.tf b/terraform/test-fixtures/issue-5254/step-1/main.tf index c30446c5a..3510fe1c4 100644 --- a/terraform/test-fixtures/issue-5254/step-1/main.tf +++ b/terraform/test-fixtures/issue-5254/step-1/main.tf @@ -3,11 +3,11 @@ variable "c" { } resource "template_file" "parent" { - count = "${var.c}" + count = var.c template = "Hi" } resource "template_file" "child" { - template = "${join(",", template_file.parent.*.template)}" - __template_requires_new = 1 + template = join(",", template_file.parent.*.template) + __template_requires_new = true }