How to add Comments in Terraform

Terraform support three (3) distinct syntax for adding comments.

# – Single line comment

# begins a single-line comment, and comments everything that follows on the same line.

// – Alternate single line comment

The same as a # but added as an alternative. Often more familiar to most programmers in other languages. Purely a preference for some.

Also note that many popular formatting tools will replace // with # when found.

/* and */ – Multi line comments

/* starts a multi-line comment and ends when a */ is found further down the script.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments