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

     1  
     2  variable "count" {
     3  }
     4  
     5  variable "source_ids" {
     6    type = "list"
     7  }
     8  
     9  variable "source_names" {
    10    type = "list"
    11  }
    12  
    13  resource "test_thing" "multi_count_var" {
    14    count = "${var.count}"
    15  
    16    # Can pluck a single item out of a multi-var
    17    source_id = "${var.source_ids[count.index]}"
    18  }
    19  
    20  resource "test_thing" "whole_splat" {
    21    # Can "splat" the ids directly into an attribute of type list.
    22    source_ids = "${var.source_ids}"
    23    source_names = "${var.source_names}"
    24    source_ids_wrapped = ["${var.source_ids}"]
    25    source_names_wrapped = ["${var.source_names}"]
    26  }