github.com/LorbusChris/terraform@v0.11.12-beta1/terraform/test-fixtures/apply-multi-var-order-interp/main.tf (about)

     1  variable "count" { default = 15 }
     2  
     3  resource "aws_instance" "bar" {
     4      count = "${var.count}"
     5      foo = "index-${count.index}"
     6  }
     7  
     8  resource "aws_instance" "baz" {
     9      count = "${var.count}"
    10      foo = "baz-${element(aws_instance.bar.*.foo, count.index)}"
    11  }
    12  
    13  output "should-be-11" {
    14      value = "${element(aws_instance.baz.*.foo, 11)}"
    15  }