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.
This commit is contained in:
Martin Atkins 2018-09-26 11:45:35 -07:00
parent f88b4fd1f4
commit b565018bf1
1 changed files with 4 additions and 4 deletions

View File

@ -3,15 +3,15 @@ variable "num" {
} }
resource "aws_instance" "a" { resource "aws_instance" "a" {
count = "${var.num}" count = var.num
} }
resource "aws_instance" "b" { resource "aws_instance" "b" {
provisioner "local-exec" { 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 # 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. # do DynamicExpand.
command = "echo ${aws_instance.a.count}" command = "echo ${length(aws_instance.a)}"
} }
} }