github.com/muratcelep/terraform@v1.1.0-beta2-not-internal-4/not-internal/configs/testdata/error-files/destroy-provisioners.tf (about) 1 locals { 2 user = "name" 3 } 4 5 resource "null_resource" "a" { 6 connection { 7 host = self.hostname 8 user = local.user # ERROR: Invalid reference from destroy provisioner 9 } 10 11 provisioner "remote-exec" { 12 when = destroy 13 index = count.index 14 key = each.key 15 16 // path and terraform values are static, and do not create any 17 // dependencies. 18 dir = path.module 19 workspace = terraform.workspace 20 } 21 } 22 23 resource "null_resource" "b" { 24 connection { 25 host = self.hostname 26 # this is OK since there is no destroy provisioner 27 user = local.user 28 } 29 30 provisioner "remote-exec" { 31 } 32 } 33 34 resource "null_resource" "b" { 35 provisioner "remote-exec" { 36 when = destroy 37 connection { 38 host = self.hostname 39 user = local.user # ERROR: Invalid reference from destroy provisioner 40 } 41 42 command = "echo ${local.name}" # ERROR: Invalid reference from destroy provisioner 43 } 44 }