tfvar icon indicating copy to clipboard operation
tfvar copied to clipboard

adding Comments to tfvars

Open Rishang opened this issue 4 years ago • 4 comments

can you add option to add comments written in variables.tf file to be printed for tfvars

eg:

# say hi variable "hi" { type = string default = "hello" }

output:

# say hi hi = "hello"

Rishang avatar Sep 15 '21 11:09 Rishang

Hi, thanks for the suggestion. Could you provide more context of the usecase of this feature and what problem are you trying to witht the comment outputs?

shihanng avatar Sep 17 '21 23:09 shihanng

For long variables.tf files, containing many variable, it good to sort variables category wise based on resource we create, and put Comments as for categorising variable

so, is same can be done to variable created tfvars file, will be useful

Rishang avatar Sep 20 '21 08:09 Rishang

I've given some thoughts about this. One thing we can do is to use the description of variables as a "comment" in the output.

shihanng avatar Oct 13 '21 22:10 shihanng

description are good for variable , but comments can be used to categorize a group of variable

Rishang avatar Oct 14 '21 12:10 Rishang