hcl2json
hcl2json copied to clipboard
Making convert Body/ Blocks/ Attributes etc public?
I would like to thank you @tmccombs for writing this library!
You think we can make convertBody, convertBlock convertExpression public? I have a requirement where I need to update several terraform files and hclwrite package makes is possible to perform that operation. However hclwrite doesn't provide easy access to all the attributes/ expression. e.g. if I want to read existing attribute and update them programatically.
I think after I convert hclwrite.Expression to hclsyntax.Expression, I should be able to read attributes from hcl to json using your library. I wish this was organically available in HCLWrite but unfortunately it's not.
hclsyntaxExpr, _ := hclsyntax.ParseExpression(tagsAttr.Expr().BuildTokens(nil).Bytes(), "", hcl.InitialPos)