From terraform-ls
Terraform LSP provides code intelligence for Terraform — diagnostics, completion, hover info, and go-to-definition for .tf and .tfvars files.
Ships in terraform-ls. Installing the plugin adds it to Claude Code.
This LSP server requires terraform-ls to be installed on your system. Make sure it's available in your PATH before enabling.
Copy this JSON into your .lsp.json to enable this server
Add to your .lsp.json or plugin.json:
{
"lspServers": {
"terraform": {
"command": "terraform-ls",
"extensionToLanguage": {
".tf": "terraform",
".tfvars": "terraform-vars",
".policy.hcl": "terraform-policy",
".tfquery.hcl": "terraform-search",
".tfdeploy.hcl": "terraform-deploy",
".policytest.hcl": "terraform-policytest",
".tfcomponent.hcl": "terraform-stack"
},
"args": [
"serve"
]
}
}
}File extensions mapped to language identifiers
Server configuration and transport parameters
terraform-lsstdioCommand-line arguments passed to the server process
Initialization options and workspace settings
Initialization Options:
{}Settings:
{}7-day visitors to each server page
npx claudepluginhub piebald-ai/claude-code-lsps --plugin terraform-ls