Merge pull request #22760 from pselle/add-source-to-diag-for_each

Add source addressing to make error more useful
This commit is contained in:
Pam Selle 2019-09-11 09:36:24 -04:00 committed by GitHub
commit 4f198fc797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -21,6 +21,7 @@ func evaluateResourceForEachExpression(expr hcl.Expression, ctx EvalContext) (fo
Severity: hcl.DiagError,
Summary: "Invalid for_each argument",
Detail: `The "for_each" value depends on resource attributes that cannot be determined until apply, so Terraform cannot predict how many instances will be created. To work around this, use the -target argument to first apply only the resources that the for_each depends on.`,
Subject: expr.Range().Ptr(),
})
}
return forEachMap, diags