From 86e9c1c45c4982bee76a469a7469be6da538116f Mon Sep 17 00:00:00 2001 From: Alper Rifat Ulucinar Date: Mon, 20 Dec 2021 11:38:09 +0300 Subject: [PATCH] Assume string type for unset Set/List/Map element types - Fixes #177 Signed-off-by: Alper Rifat Ulucinar --- pkg/types/builder.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/types/builder.go b/pkg/types/builder.go index 4ab4ba8e..9ee85681 100644 --- a/pkg/types/builder.go +++ b/pkg/types/builder.go @@ -280,6 +280,9 @@ func (g *Builder) buildSchema(sch *schema.Schema, cfg *config.Resource, tfPath [ } elemType = paramType } + // if unset + case types.Nil: + elemType = types.Universe.Lookup("string").Type() default: return nil, errors.Errorf("element type of %s should be either schema.Resource or schema.Schema", fieldPath(names)) }