From 3be3e3c089776a9c09d0fb45227dfcc383a0a0d1 Mon Sep 17 00:00:00 2001 From: Pam Selle <204372+pselle@users.noreply.github.com> Date: Tue, 10 Sep 2019 14:56:11 -0400 Subject: [PATCH] Add source addressing to make error more useful --- terraform/eval_for_each.go | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/eval_for_each.go b/terraform/eval_for_each.go index f03e02c27311..507bf7f289ea 100644 --- a/terraform/eval_for_each.go +++ b/terraform/eval_for_each.go @@ -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