From ebea080aca7c497ce5ab517b2441481c21392b8f Mon Sep 17 00:00:00 2001 From: Paul Tyng Date: Mon, 24 Jun 2019 15:27:00 -0400 Subject: [PATCH] Add missing bool case Fixes #20572 --- lang/funcs/collection.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lang/funcs/collection.go b/lang/funcs/collection.go index 3f0e2bd16..fd0de9ea5 100644 --- a/lang/funcs/collection.go +++ b/lang/funcs/collection.go @@ -689,8 +689,10 @@ var LookupFunc = function.New(&function.Spec{ return cty.StringVal(v.AsString()), nil case ty.Equals(cty.Number): return cty.NumberVal(v.AsBigFloat()), nil + case ty.Equals(cty.Bool): + return cty.BoolVal(v.True()), nil default: - return cty.NilVal, errors.New("lookup() can only be used with flat lists") + return cty.NilVal, errors.New("lookup() can only be used with maps of primitive types") } } }