Recall & Review
beginner
What symbol is used for a single-line comment in HCL?
The
# or // symbols are used for single-line comments in HCL.Click to reveal answer
beginner
How do you write a multi-line comment in HCL?
Use
/* to start and */ to end a multi-line comment in HCL.Click to reveal answer
beginner
Why are comments useful in Terraform configuration files?
Comments help explain the purpose of code, making it easier to understand and maintain.
Click to reveal answer
beginner
Can comments affect the behavior of Terraform configurations?
No, comments are ignored by Terraform and do not affect configuration behavior.
Click to reveal answer
beginner
Show an example of a single-line and a multi-line comment in HCL.
Single-line comment:
# This is a comment or // This is a comment<br>Multi-line comment:<br>/*<br>This is a<br>multi-line comment<br>*/Click to reveal answer
Which of the following is NOT a valid way to write a comment in HCL?
✗ Incorrect
HCL does not support HTML-style comments like
. Use #, //, or /* */ instead.What happens to comments when Terraform processes a configuration file?
✗ Incorrect
Terraform ignores comments; they do not affect the configuration or execution.
Which symbols can start a single-line comment in HCL?
✗ Incorrect
Single-line comments in HCL start with either
# or //.How do you write a multi-line comment in HCL?
✗ Incorrect
Multi-line comments in HCL are enclosed between
/* and */.Why should you use comments in your Terraform files?
✗ Incorrect
Comments help explain the code, making it easier for others (and yourself) to understand and maintain.
Explain how to write single-line and multi-line comments in HCL and why they are important.
Think about how you add notes in a text to help yourself or others understand it later.
You got /4 concepts.
Describe the impact of comments on Terraform configuration behavior.
Consider if Terraform treats comments like code or just skips them.
You got /3 concepts.