We used to use a different option available built in VS Code and I think its a better solution here.(Given that you already have the Hashicorp Terraform extension. If not Just install it). Later you can enable format on save following this guide: https://medium.com/nerd-for-tech/how-to-auto-format-hcl-terraform-code-in-visual-studio-code-6fa0e7afbb5e
This is something we followed in my previous workplace and hope this helps. Maybe because this question is older it might have not been a feature back then.