How would one programmatically formatting Terraform HCL

This page summarizes the projects mentioned and recommended in the original post on /r/Terraform

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • hcl

    HCL is the HashiCorp configuration language.

  • Format is HCL language feature: https://github.com/hashicorp/hcl/blob/main/hclwrite/public.go

  • lingon

    Discontinued Lingon is a collection of libraries and tools for building platforms using Go.

  • We built Lingon (https://github.com/volvo-cars/lingon/tree/main/docs/terraform) to generate terraform HCL from Go code. It might be useful or at least a good reference of using the hclwrite package:

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • terraform

    Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.

  • Source for what terraform fmt does: https://github.com/hashicorp/terraform/blob/main/internal/repl/format.go

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts