Interview Prep/Terraform/IaC and Terraform Fundamentals

How do you write comments and multi-line strings in HCL?

BeginnerConceptIaC and Terraform Fundamentals
Answer

Use # or // for single-line comments and /* ... */ for blocks. Multi-line strings use heredocs; <<-EOT strips leading indentation.

user_data = <<-EOT
  #!/bin/bash
  dnf install -y nginx
EOT
All Terraform questions Roadmap: Terraform

More on IaC and Terraform Fundamentals