I'm hoping there is something to pick up when I have misspelled variables and comments to save me some time when I'm checking my code and reduce the potential for any errors.

I normally use IntelliJ IDE for Terraform on a MAC but also have VS code set up that I can use.

Is there a plugin for either I could use or even a different tool? I imaging variable might be difficult to lint due as I use underscores to separate words in my variable names so the tool would need to know to treat underscores as white space for linting purposes.


terraform fmt

The terraform fmt command is used to rewrite Terraform configuration files to a canonical format and style.

  • I already use that. – doug Dec 6 '20 at 21:34
  • Thanks anyway though. I'm after something to spell check for me. I use terraform fmt to formate run terraform plan to check it should run. But for spelling, I currently do git compare with branch then look through each bit I changed and copy all my comments and variable names I'm not 100% sure about to word and change any seportors for spaces then see if anything gets highlighted. It's just really not a time-efficient process for that part of it. – doug Dec 6 '20 at 21:46
  • @doug it might be easier using an IDE that has spell check (or a plugin thereof). – mikequentel Dec 9 '20 at 21:00
  • The issue I had when I last tried that in VS code was the spell check plugin I used thought all the resources were misspelled as it couldn't pick out words separated by underscores. So I need it to treat - . and _ as if they were spaces so it can tell if the words separated by them are spelled correctly. – doug Dec 11 '20 at 8:06

VSCode has a Terraform Linter "l2fprod.terraform-fork" Have NOT tried it. Did a simple search terra + lint. HTH DrewBai


You can use tflint project. It has lot of plugins for cloud providers. https://github.com/terraform-linters/tflint

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.