Closed luonmincuoi872 closed 1 year ago
vote up!
can I understand your use case of using .generate method?
I init data return from generate method into monaco editor as i checked monaco editor not support format hcl code (and some other language like java ...) Is it posible to format terraform code in generate method?
There is no plan to format it using javascript at the moment, it is mentioned in README limitation section too. I might revisit this if I have time.
The reason why I didn't do it is because I usually write it into a file, the .write()
method has an options to format the file using terraform fmt
.
I am not familiar with monaco editor, could you explore whether it is possible to run terraform fmt
?
Actually, my project is use reactjs and there is an error when i used .write() method. fs.existssync is not a function I have not find the sollution yet. i dont know how is the content of generated terraform file.
It is suppose to be used in backend Nodejs. Using with react is not something I thought about and catered for.
I will update here if I manage to make .generate
produce prettified text.
Describe the bug Terraform value from tfg.generate().tf is not pretty
To reproduce
tfg.generate().tf return bellow
Expected behavior