make validation on for_each argument more precise

This commit is contained in:
tmatias 2019-07-31 19:29:14 -03:00
parent 5cb80c43c1
commit e825dd0428
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.CanIterateElements() || forEachVal.Type().IsListType() {
if !forEachVal.Type().IsMapType() && !forEachVal.Type().IsSetType() {
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Invalid for_each argument",