github.com/LorbusChris/terraform@v0.11.12-beta1/terraform/test-fixtures/input-vars/main.tf (about)

     1  variable "amis" {
     2      default = {
     3          us-east-1 = "foo"
     4          us-west-2 = "bar"
     5      }
     6  }
     7  
     8  variable "bar" {
     9      default = "baz"
    10  }
    11  
    12  variable "foo" {}
    13  
    14  resource "aws_instance" "foo" {
    15      num = "2"
    16      bar = "${var.bar}"
    17  }
    18  
    19  resource "aws_instance" "bar" {
    20      foo = "${var.foo}"
    21      bar = "${lookup(var.amis, var.foo)}"
    22  }