Skip to content

Commit

Permalink
Merge pull request #22760 from pselle/add-source-to-diag-for_each
Browse files Browse the repository at this point in the history
Add source addressing to make error more useful
  • Loading branch information
Pam Selle authored Sep 11, 2019
2 parents de98de5 + 3be3e3c commit 4f198fc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions terraform/eval_for_each.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4f198fc

Please sign in to comment.