opentofu/terraform/testdata/apply-provisioner-destroy-multiple-locals/main.tf
2019-06-30 10:16:15 +02:00

27 lines
497 B
HCL

locals {
value = "local"
foo_id = aws_instance.foo.id
// baz is not in the state during destroy, but this is a valid config that
// should not fail.
baz_id = aws_instance.baz.id
}
resource "aws_instance" "baz" {}
resource "aws_instance" "foo" {
provisioner "shell" {
id = self.id
command = local.value
when = "destroy"
}
}
resource "aws_instance" "bar" {
provisioner "shell" {
id = self.id
command = local.foo_id
when = "destroy"
}
}