diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b492f6..1c54ca6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +* Incorrect enconding of HCL lists. [#27] + ## [1.1.1] - 2020-03-31 ### Fixed @@ -46,3 +50,4 @@ Initial version with support for managing: [#19]: https://github.com/rgreinho/tfe-cli/pull/19 [#20]: https://github.com/rgreinho/tfe-cli/pull/20 [#23]: https://github.com/rgreinho/tfe-cli/pull/23 +[#27]: https://github.com/rgreinho/tfe-cli/pull/27 diff --git a/cmd/variable.go b/cmd/variable.go index 292fa29..dea4553 100644 --- a/cmd/variable.go +++ b/cmd/variable.go @@ -89,7 +89,7 @@ var variableCreateCmd = &cobra.Command{ for i := 0; i < value.Len(); i++ { b[i] = fmt.Sprintf("%s", value.Index(i)) } - HCLVarFile = append(HCLVarFile, fmt.Sprintf("%s=[%s]", k, strings.Join(b, ", "))) + HCLVarFile = append(HCLVarFile, fmt.Sprintf("%s=[\"%s\"]", k, strings.Join(b, "\", \""))) } else { // Otherwise it is always a regular variable. regularVarFile = append(regularVarFile, fmt.Sprintf("%s=%s", k, strct.Interface()))