Merge pull request #22279 from tmatias/for-each-argument-value-validation

make diagnose on for_each argument more precise
This commit is contained in:
Pam Selle 2019-08-01 11:22:23 -04:00 committed by GitHub
commit 07ee88b73b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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.CanIterateElements() || forEachVal.Type().IsListType() || forEachVal.Type().IsTupleType() {
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Invalid for_each argument",