Skip to content

Manually Setting the Terraform Executable Path

Audrey Eschright edited this page Jun 4, 2020 · 4 revisions

You can manually override how terraform is invoked in the LS in the extension settings.

To do so, modify the args passed to the Language Server (note that for terraform-ls it should always start with serve):

"terraform.languageServer": {
  "external": true,
  "args": [
    "serve",
    "-tf-exec=/home/paul/go/bin/terraform",
  ]
}

Valid options for the terraform-ls serve command are as follows:

Usage: terraform-ls serve [options]

Starts the Language Server

Options:

  -log-file string
        path to a file to log into with support for variables (e.g. Timestamp, Pid, Ppid) via Go template syntax {{.VarName}}
  -port int
        port number to listen on (turns server into TCP mode)
  -tf-exec string
        path to Terraform binary
  -tf-exec-timeout string
        Overrides Terraform execution timeout (e.g. 30s)
  -tf-log-file string
        path to a file for Terraform executions to be logged into with support for variables (e.g. Timestamp, Pid, Ppid) via Go template syntax {{.VarName}}
Clone this wiki locally