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
More on IaC and Terraform Fundamentals
What is Infrastructure as Code and why do teams use it?BeginnerWhat is the difference between declarative and imperative infrastructure tools?BeginnerWhat is Terraform and what problem does it solve?BeginnerWhat is HCL and can Terraform use anything else?BeginnerWhich files make up a typical Terraform root module?BeginnerHow does Terraform work internally?Advanced