github.com/LorbusChris/terraform@v0.11.12-beta1/terraform/test-fixtures/apply-provisioner-destroy-multiple-locals/main.tf (about) 1 locals { 2 value = "local" 3 foo_id = "${aws_instance.foo.id}" 4 5 // baz is not in the state during destroy, but this is a valid config that 6 // should not fail. 7 baz_id = "${aws_instance.baz.id}" 8 } 9 10 resource "aws_instance" "baz" {} 11 12 resource "aws_instance" "foo" { 13 provisioner "shell" { 14 command = "${local.value}" 15 when = "destroy" 16 } 17 } 18 19 resource "aws_instance" "bar" { 20 provisioner "shell" { 21 command = "${local.foo_id}" 22 when = "destroy" 23 } 24 }