github.com/turtlemonvh/terraform@v0.6.9-0.20151204001754-8e40b6b855e8/terraform/test-fixtures/apply-vars/main.tf (about)

     1  variable "amis" {
     2      default = {
     3          us-east-1 = "foo"
     4          us-west-2 = "foo"
     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      baz = "${var.amis.us-east-1}"
    23  }