Merge pull request #23862 from hashicorp/jbardin/destroy-prov-path

it's safe for destroy provisioners to access path
This commit is contained in:
James Bardin 2020-01-15 16:59:34 -05:00 committed by GitHub
commit 94b1792b99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -127,7 +127,7 @@ func onlySelfRefs(body hcl.Body) hcl.Diagnostics {
for _, v := range attr.Expr.Variables() {
valid := false
switch v.RootName() {
case "self":
case "self", "path", "terraform":
valid = true
case "count":
// count must use "index"

View File

@ -13,6 +13,10 @@ resource "null_resource" "a" {
index = count.index
key = each.key
// path and terraform values are static, and do not create any
// dependencies.
dir = path.module
workspace = terraform.workspace
}
}