// terraform emits a formatting suitable for Terraform func terraform(w io.Writer, result []string) { for k, v := range envmap.ToMap(result) { fmt.Fprintf(w, `variable "%s" { type = "string" default = "%s" } `, k, v) } }
// cloudformation emits a formatting suitable for AWS CloudFormation stacks func cloudformation(w io.Writer, result []string) { var list []string for k, v := range envmap.ToMap(result) { list = append(list, fmt.Sprintf(`"%s": { "Default": "%s", "Type": "String" }`, k, v)) } fmt.Fprintln(w, strings.Join(list, ",\n")) }