in pkg/transform_update_in_place.go [82:94]
func decodeAsDynamicBlockBody(dest *hclwrite.Block, patch *hclwrite.Block) error {
for n, attribute := range patch.Body().Attributes() {
dest.Body().SetAttributeRaw(n, attribute.Expr().BuildTokens(nil))
}
for _, b := range patch.Body().Blocks() {
blockType := b.Type()
newNestedBlock := dest.Body().AppendNewBlock(blockType, b.Labels())
if err := decodeAsDynamicBlockBody(newNestedBlock, b); err != nil {
return err
}
}
return nil
}