mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 18:01:01 -06:00
23 lines
324 B
HCL
23 lines
324 B
HCL
variable "amis" {
|
|
default = {
|
|
us-east-1 = "foo"
|
|
us-west-2 = "bar"
|
|
}
|
|
}
|
|
|
|
variable "bar" {
|
|
default = "baz"
|
|
}
|
|
|
|
variable "foo" {}
|
|
|
|
resource "aws_instance" "foo" {
|
|
num = "2"
|
|
bar = "${var.bar}"
|
|
}
|
|
|
|
resource "aws_instance" "bar" {
|
|
foo = "${var.foo}"
|
|
bar = "${lookup(var.amis, var.foo)}"
|
|
}
|