github.com/LorbusChris/terraform@v0.11.12-beta1/terraform/test-fixtures/apply-provisioner-interp-count/provisioner-interp-count.tf (about)

     1  variable "count" {
     2    default = 3
     3  }
     4  
     5  resource "aws_instance" "a" {
     6    count = "${var.count}"
     7  }
     8  
     9  resource "aws_instance" "b" {
    10    provisioner "local-exec" {
    11      # Since we're in a provisioner block here, this interpolation is
    12      # resolved during the apply walk and so the resource count must
    13      # be interpolated during that walk, even though apply walk doesn't
    14      # do DynamicExpand.
    15      command = "echo ${aws_instance.a.count}"
    16    }
    17  }