in module.go [115:145]
func (m *Module) parseOutput(b *hcl.Block, f *hcl.File) Output {
content, _, _ := b.Body.PartialContent(&hcl.BodySchema{
Attributes: []hcl.AttributeSchema{
{
Name: "value",
Required: true,
},
{
Name: "description",
},
{
Name: "sensitive",
},
},
})
attributes := content.Attributes
o := Output{
Name: b.Labels[0],
Range: b.DefRange,
Value: attributeValueString(attributes["value"], f),
}
if desc, ok := attributes["description"]; ok {
o.Description = attributeValueString(desc, f)
}
if sensitive, ok := attributes["sensitive"]; ok {
o.Sensitive = attributeValueString(sensitive, f)
}
// We don't compare position's change
o.Range = hcl.Range{}
return o
}