diagnose tuple values being passed as argument to for_each

This commit is contained in:
tmatias 2019-08-01 11:33:46 -03:00
parent e825dd0428
commit c20c40c9aa
No known key found for this signature in database
GPG Key ID: 6B54626DE81BEB98
1 changed files with 1 additions and 1 deletions

View File

@ -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",