mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-26 17:01:04 -06:00
27 lines
497 B
HCL
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"
|
|
}
|
|
}
|