Merge pull request #23862 from hashicorp/jbardin/destroy-prov-path
it's safe for destroy provisioners to access path
This commit is contained in:
commit
94b1792b99
|
@ -127,7 +127,7 @@ func onlySelfRefs(body hcl.Body) hcl.Diagnostics {
|
||||||
for _, v := range attr.Expr.Variables() {
|
for _, v := range attr.Expr.Variables() {
|
||||||
valid := false
|
valid := false
|
||||||
switch v.RootName() {
|
switch v.RootName() {
|
||||||
case "self":
|
case "self", "path", "terraform":
|
||||||
valid = true
|
valid = true
|
||||||
case "count":
|
case "count":
|
||||||
// count must use "index"
|
// count must use "index"
|
||||||
|
|
|
@ -13,6 +13,10 @@ resource "null_resource" "a" {
|
||||||
index = count.index
|
index = count.index
|
||||||
key = each.key
|
key = each.key
|
||||||
|
|
||||||
|
// path and terraform values are static, and do not create any
|
||||||
|
// dependencies.
|
||||||
|
dir = path.module
|
||||||
|
workspace = terraform.workspace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue