From b565018bf1281268dc1b0747211d8a18654b4a4a Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 26 Sep 2018 11:45:35 -0700 Subject: [PATCH] core: Fix TestContext2Apply_provisionerInterpCount This was relying on a no-longer-valid mechanism for accessing the "count" value from a resource block. The original issue this test was written to cover is not really such a sharp edge anymore, since the length is taken from the state during apply rather than from configuration, but it's still a good case to cover. --- .../provisioner-interp-count.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/terraform/test-fixtures/apply-provisioner-interp-count/provisioner-interp-count.tf b/terraform/test-fixtures/apply-provisioner-interp-count/provisioner-interp-count.tf index 236325d59..337129e61 100644 --- a/terraform/test-fixtures/apply-provisioner-interp-count/provisioner-interp-count.tf +++ b/terraform/test-fixtures/apply-provisioner-interp-count/provisioner-interp-count.tf @@ -3,15 +3,15 @@ variable "num" { } resource "aws_instance" "a" { - count = "${var.num}" + count = var.num } resource "aws_instance" "b" { provisioner "local-exec" { - # Since we're in a provisioner block here, this interpolation is + # Since we're in a provisioner block here, this expression is # resolved during the apply walk and so the resource count must - # be interpolated during that walk, even though apply walk doesn't + # be known during that walk, even though apply walk doesn't # do DynamicExpand. - command = "echo ${aws_instance.a.count}" + command = "echo ${length(aws_instance.a)}" } }