/ #tools 

Full 0.12 Syntax Support with the new Terraform Visual Studio Code Extension

I used many text editors during my career: Notepad++, Sublime Text, Atom, and finally Visual Studio Code which has remained my preferred code editor since 2016.

As I was using Terraform quite a lot in the past year, I naturally installed the Terraform Visual Studio Code Extension. I was satisfied until I switched to Terraform 0.12: after that, I started to get warnings/errors, although my syntax was OK.

For example (see screenshot below): Data source terraform_remote_state does not exist.

Data source terraform_remote_state does not exist error in Visual Studio Code

There was nothing really blocking as my code was still working, but I had a lot of red warnings, which was not visually pleasing. This was a known bug, and some workarounds existed, but I was impatient for it to be resolved.

That’s why I was thrilled when HashiCorp announced one month ago that they took over the support of the Visual Studio Code extension for Terraform.

I updated the Terraform extension to the latest version today, and TADAAA! No more errors! šŸ™Œ

Full 0.12 Syntax Support with the new Terraform Visual Studio Code Extension

I was not able to fully test the new version of the extension, but it looks very promising:

  • New Language Server package from HashiCorp
  • Syntax highlighting up to date with all HCL2 features (as needed for Terraform 0.12 and above)

Keep up the good work guys! \o/

Resources:

Author

Romain

Staff Technical Product Manager, technologist with 16+ years of Networking and Security experience in Data Center, Public Cloud & Virtualization (VMs and Containers). He is a double VCDX (DCV and NV, #120), VCDX panelist, frequent VMUG/VMworld speaker and contributor to the community via this blog or social media (follow him on Twitter @woueb).