mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
25 lines
321 B
HCL
25 lines
321 B
HCL
locals {
|
|
"count" = 1
|
|
}
|
|
|
|
resource "test_instance" "foo" {
|
|
count = "${local.count}"
|
|
}
|
|
|
|
output "foo_id" {
|
|
value = "${test_instance.foo.id}"
|
|
}
|
|
|
|
variable "condition" {
|
|
default = "true"
|
|
}
|
|
|
|
resource "test_instance" "bar" {
|
|
count = "${var.condition ? 1 : 0}"
|
|
}
|
|
|
|
|
|
output "bar_id" {
|
|
value = "${test_instance.bar.id}"
|
|
}
|