Fixes issue where attribute in nested is not of list type/is invalid and would panic
This commit is contained in:
parent
3cda2bd7a5
commit
cd83e6108d
|
@ -33,7 +33,7 @@ func walkVariables(node dynblock.WalkVariablesNode, body hcl.Body, schema *confi
|
|||
for _, child := range children {
|
||||
if blockS, exists := schema.BlockTypes[child.BlockTypeName]; exists {
|
||||
vars = append(vars, walkVariables(child.Node, child.Body(), &blockS.Block)...)
|
||||
} else if attrS, exists := schema.Attributes[child.BlockTypeName]; exists && attrS.Type.ElementType().IsObjectType() {
|
||||
} else if attrS, exists := schema.Attributes[child.BlockTypeName]; exists && attrS.Type.IsCollectionType() && attrS.Type.ElementType().IsObjectType() {
|
||||
synthSchema := SchemaForCtyElementType(attrS.Type.ElementType())
|
||||
vars = append(vars, walkVariables(child.Node, child.Body(), synthSchema)...)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue