github.com/hashicorp/terraform-plugin-sdk@v1.17.2/terraform/testdata/input-vars/main.tf (about) 1 variable "amis" { 2 default = { 3 us-west-2 = "bar" 4 } 5 } 6 7 variable "bar" { 8 default = "baz" 9 } 10 11 variable "foo" {} 12 13 resource "aws_instance" "foo" { 14 num = "2" 15 bar = var.bar 16 } 17 18 resource "aws_instance" "bar" { 19 foo = var.foo 20 bar = var.amis[var.foo] 21 }