mirror of https://github.com/hashicorp/terraform
parent
5fa24a0128
commit
048af6e237
@ -0,0 +1,6 @@
|
||||
resource "test_instance" "foo" {
|
||||
}
|
||||
|
||||
output "foo_id" {
|
||||
value = "${test_instance.foo.id}"
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
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}"
|
||||
}
|
||||
Loading…
Reference in new issue