Skip to content

Commit

Permalink
Add source addressing to make error more useful
Browse files Browse the repository at this point in the history
This commit was generated from hashicorp/terraform#22760.
  • Loading branch information
kmoe committed Sep 15, 2019
1 parent 8e7627a commit 45d4ca7
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 forEach 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 45d4ca7

Please sign in to comment.