VladRassokhin / intellij-hcl

HCL language support for IntelliJ platform based IDEs
Apache License 2.0
244 stars 47 forks source link

Support calling terraform located "in" wsl / tfenv #245

Open G-Rath opened 5 years ago

G-Rath commented 5 years ago

I'm on Windows, and using wsl + tfenv to manage my actual terraform installs.

It'd be great if intellij-hcl supported utilizing that.

Bonus points if it's possible to hook into tfenv directly so that it "just works" version-wise.

I'm happy to help where I can, and can run "tests" on my machine if you don't have a Windows setup on hand :)

KyleMarMc commented 3 years ago

As an example of the issue I'm seeing with this, setting the location of Terraform to \\wsl$\<distro>\home\<username>\.tfenv\bin\terraform results in this error when trying to use the Terraform build configurations:

"C:\Program Files (x86)\JetBrains\PyCharm 2020.3.3\bin\runnerw64.exe" \\wsl$\<distro>\home\<username>\.tfenv\bin\terraform init
runnerw.exe: CreateProcess failed with error 193: %1 is not a valid Win32 application.

Process finished with exit code 193
ImIOImI commented 2 years ago

tfenv is configured differently for me. Here's an example:

❯ which terraform
/home/linuxbrew/.linuxbrew/bin/terraform
❯ which terraform
/home/linuxbrew/.linuxbrew/bin/terraform
❯ terraform version
Terraform v1.1.7
on linux_amd64

Your version of Terraform is out of date! The latest version
is 1.2.5. You can update by downloading from https://www.terraform.io/downloads.html
❯ tfenv use 0.12.31
Switching default version to v0.12.31
Switching completed
❯ which terraform
/home/linuxbrew/.linuxbrew/bin/terraform
❯ terraform version
Terraform v0.12.31

So I assume whatever solution is decided on will have to be able to point to terraform in different locations