Skip to content

v1.106.1

Compare
Choose a tag to compare
@cloudposse-releaser cloudposse-releaser released this 15 Nov 19:25
· 73 commits to refs/heads/main since this release
81f6db2
Update gettings started, add $schema directive at the top of files @osterman (#769)

what

  • Remove unimplemented commands
  • $schema directive at the top of files

why

  • Not everyone will have $schema validation enabled by default in their editor
Enhance `WriteToFileAsJSON` with pretty-printing support @RoseSecurity (#783)

what

  • Used the ConvertToJSON utility with json.MarshalIndent to produce formatted JSON
  • Indentation is set to two spaces (" ") for consistent readability

why

  • This PR improves the WriteToFileAsJSON function by introducing pretty-printing for JSON outputs. Previously, the function serialized JSON using a compact format, which could make the resulting files harder to read. With this change, all JSON written by this function will now be formatted with indentation, making it easier for developers and users to inspect and debug the generated files

  • This specifically addresses #778 , which previously rendered auto-generated backends as:

{
   "terraform": {
   "backend": {
   "s3": {
   "acl": "bucket-owner-full-control",
   "bucket": "my-tfstate-bucket",
   "dynamodb_table": "some-dynamo-table",
   "encrypt": true,
   "key": "terraform.tfstate",
   "profile": "main",
   "region": "us-west-2",
   "workspace_key_prefix": "something"
}
}
}
}

With this addition, the output appears as:

{
  "terraform": {
    "backend": {
      "s3": {
        "acl": "bucket-owner-full-control",
        "bucket": "my-tfstate-bucket",
        "dynamodb_table": "some-dynamo-table",
        "encrypt": true,
        "key": "terraform.tfstate",
        "profile": "main",
        "region": "us-west-2",
        "workspace_key_prefix": "something"
      }
    }
  }
}

references