Skip to content

Commit

Permalink
diagnose tuple values being passed as argument to for_each
Browse files Browse the repository at this point in the history
  • Loading branch information
tmatias committed Aug 1, 2019
1 parent e825dd0 commit c20c40c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion terraform/eval_for_each.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func evaluateResourceForEachExpressionKnown(expr hcl.Expression, ctx EvalContext
return map[string]cty.Value{}, false, diags
}

if !forEachVal.Type().IsMapType() && !forEachVal.Type().IsSetType() {
if !forEachVal.CanIterateElements() || forEachVal.Type().IsListType() || forEachVal.Type().IsTupleType() {
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Invalid for_each argument",
Expand Down

0 comments on commit c20c40c

Please sign in to comment.