func ReplaceOutputs()

in types/hcl.go [113:124]


func ReplaceOutputs(block *hclwrite.Block, outputs []Output) {
	for attrName, attr := range block.Body().Attributes() {
		attrValue := string(attr.Expr().BuildTokens(nil).Bytes())
		for _, output := range outputs {
			attrValue = strings.ReplaceAll(attrValue, output.OldName, output.NewName)
		}
		block.Body().SetAttributeRaw(attrName, helper.GetTokensForExpression(attrValue))
	}
	for index := range block.Body().Blocks() {
		ReplaceOutputs(block.Body().Blocks()[index], outputs)
	}
}