HCL (HashiCorp Configuration Language) is a configuration language developed by HashiCorp for Infrastructure as Code (IaC) tools like Terraform. It combines JSON's machine-readability with human-readability, supporting block structures, attribute assignments, expressions, and comments โ the core language for cloud-native infrastructure management.
resource "aws_instance" "web" { ... }ami = "ami-12345"var.instance_type#, // (line) and /* */ (block)condition ? true_val : false_val[for s in var.list: upper(s)]HCL (HashiCorp Configuration Language) is a configuration language developed by HashiCorp for tools like Terraform. It combines JSON's machine-readability with human-readability, supporting block structures, attribute assignments, expressions, and comments.
HCL is a superset of JSON: 1) HCL supports comments (# and //), JSON does not; 2) HCL supports block structures (resource blocks etc.), JSON uses nested objects; 3) HCL supports expressions and variable interpolation, JSON only supports literals; 4) HCL is easier to read and write, JSON is more strict.
This tool automatically formats HCL code according to terraform fmt standards: consistent 2-space indentation, aligned equals signs, standardized block structures, and organized comments. You can also use the terraform fmt CLI command.
Formatted Terraform code: 1) Is easier to read and maintain; 2) Reduces style conflicts in team collaboration; 3) Conforms to terraform fmt standards; 4) Makes code review more effective at finding configuration errors; 5) Improves Infrastructure as Code professionalism.
No. All HCL formatting and validation happens locally in your browser. Your infrastructure configuration is never sent to any server, ensuring security.