{"id":13588846,"url":"https://github.com/hashicorp/vscode-terraform","last_synced_at":"2026-04-02T13:29:21.209Z","repository":{"id":36990405,"uuid":"67683496","full_name":"hashicorp/vscode-terraform","owner":"hashicorp","description":"HashiCorp Terraform VSCode extension","archived":false,"fork":false,"pushed_at":"2025-05-05T06:11:38.000Z","size":23701,"stargazers_count":942,"open_issues_count":142,"forks_count":184,"subscribers_count":37,"default_branch":"main","last_synced_at":"2025-05-07T23:02:11.407Z","etag":null,"topics":["hcl","syntax-highlighting","terraform","visual-studio-code","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashicorp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-09-08T08:22:05.000Z","updated_at":"2025-04-16T23:33:31.000Z","dependencies_parsed_at":"2023-10-10T20:26:04.185Z","dependency_job_id":"320dc0c0-278f-4193-b102-d8f7876ff89b","html_url":"https://github.com/hashicorp/vscode-terraform","commit_stats":{"total_commits":1612,"total_committers":63,"mean_commits":25.58730158730159,"dds":0.7270471464019851,"last_synced_commit":"9e84970a61ef902793274a7efcfe701cbe8eb20f"},"previous_names":[],"tags_count":115,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fvscode-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fvscode-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fvscode-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fvscode-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashicorp","download_url":"https://codeload.github.com/hashicorp/vscode-terraform/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110374,"owners_count":22016391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hcl","syntax-highlighting","terraform","visual-studio-code","vscode","vscode-extension"],"created_at":"2024-08-01T15:06:58.774Z","updated_at":"2026-04-02T13:29:21.202Z","avatar_url":"https://github.com/hashicorp.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","HarmonyOS","Awesome Tools","vscode-extension"],"sub_categories":["Windows Manager","IDEs"],"readme":"# Terraform Extension for Visual Studio Code\n\nThe HashiCorp [Terraform Extension for Visual Studio Code (VS Code)](https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform) with the [Terraform Language Server](https://github.com/hashicorp/terraform-ls) adds editing features for [Terraform](https://www.terraform.io), Terraform Stacks and Terraform Search files such as syntax highlighting, IntelliSense, code navigation, code formatting, module explorer and much more!\n\n## Quick Start\n\nGet started writing Terraform configurations with VS Code in three steps:\n\n- **Step 1:** If you haven't done so already, install [Terraform](https://www.terraform.io/downloads)\n\n- **Step 2:** Install the [Terraform Extension for VS Code](https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform).\n\n- **Step 3:** To activate the extension, open any folder or VS Code workspace containing Terraform, Terraform Stacks or Terraform Search files. Once activated, the Terraform language indicator will appear in the bottom right corner of the window.\n\nNew to Terraform? Read the [Terraform Learning guides](https://learn.hashicorp.com/terraform)\n\nSee [Usage](#usage) for more detailed getting started information.\n\nRead the [Troubleshooting Guide](#troubleshooting) for answers to common questions.\n\n## Features\n\nThis extension provides Terraform, Terraform Stacks and Terraform Search language features. For most features Terraform Stacks and Terraform Search support is implied, specific functionality is called out where approprite.\n\n- [IntelliSense](#intellisense-and-autocomplete) Edit your code with auto-completion of providers, resource names, data sources, attributes, components and more\n- [Syntax validation](#syntax-validation) Provides inline diagnostics for invalid configurations as you type\n- [Syntax highlighting](#syntax-highlighting) Highlighting syntax for Terraform 0.12 to 1.X, Terraform Stacks and Terraform Search\n- [Code Navigation](#code-navigation) Navigate through your codebase with Go to Definition and Symbol support\n- [Code Formatting](#code-formatting) Format your code with `terraform fmt` automatically\n- [Code Snippets](#code-snippets) Shortcuts for common snippets like `for_each` and `variable`\n- [HCP Terraform Integration](#hcp-terraform-integration) View HCP Terraform Workspaces and Run details inside VS Code\n- [Terraform Module Explorer](#terraform-module-and-provider-explorer) View all modules and providers referenced in the currently open document.\n- [Terraform commands](#terraform-commands) Directly execute commands like `terraform init` or `terraform plan` from the VS Code Command Palette.\n\n### IntelliSense and Autocomplete\n\nThe Terraform Extension for VS Code provides IntelliSense support for Terraform, Terraform Stacks and Terraform Search.\n\nIntelliSense is a general term for a variety of code editing features including: code completion, parameter info, quick info, and member lists. IntelliSense features are sometimes called by other names such as autocomplete, code completion, and code hinting.\n\nFor Terraform constructs like resource and data, labels, blocks and attributes are auto completed both at the root of the document and inside other blocks. This also works for Terraform modules that are installed in the workspace, attributes and other constructs are autocompleted.\n\nFor Terraform Stacks constructs like component and resource, blocks and attributes are auto completed both at the root of the document and inside other blocks. This also works for Terraform Stack components that are installed in the workspace, attributes and other constructs are autocompleted.\n\nFor Terraform Search files, the extension provides auto-completion for search specific blocks and attributes, helping you build effective queries to find resources and configurations across your Terraform codebase.\n\nThis means that you can benefit from auto-completion, parameter info, quick info, and member lists when working with Terraform, Terraform Stacks, and Terraform Search files. Whether you're defining stacks, resources, variables, or search queries, the extension will provide context-specific completions to help you write your code more efficiently.\n\n\u003e **Note:** If there are syntax errors present in the document upon opening, intellisense may not provide all completions. Please fix the errors and reload the document and intellisense will return. See [hcl-lang#57](https://github.com/hashicorp/hcl-lang/issues/57) for more information.\n\nInvoking intellisense is performed through the [keyboard combination](https://code.visualstudio.com/docs/getstarted/keybindings) for your platform and the results depend on where the cursor is placed.\n\nIf the cursor is at the beginning of a line and no other characters are present, then a list of constructs like `data`, `provider`, `resource`, etc are shown.\n\n![](docs/intellisense1.png)\n\nIf inside a set of quotes or inside a block, the extension provides context specific completions appropriate for the location. For example, inside a `resource` block attributes for a given provider are listed.\n\n![](docs/intellisense2.png)\n\nCombining `editor.suggest.preview` with the [pre-fill required fields](#code-completion) setting will provide inline snippet suggestions for blocks of code:\n\n![](docs/intellisense3.png)\n\nCompleting the snippet allows you to tab complete through each attribute and block.\n\n### Syntax Validation\n\nTerraform, Terraform Stacks and Terraform Search configuration files are validated when opened and on change, and invalid code is marked with diagnostics.\n\nHCL syntax is checked for e.g. missing control characters like `}`, `\"` or others in the wrong place.\n\n![](docs/validation-rule-hcl.png)\n\nEnhanced validation of selected Terraform language constructs in both `*.tf` and `*.tfvars` files based on detected Terraform version and provider versions is also provided. This validation also extends to language constructs for Terraform Search (`*.tfquery.hcl`) and Terraform Stacks (`*.tfcomponent.hcl` and `*.tfdeploy.hcl`).\n\nThis can highlight deprecations, missing required attributes or blocks, references to undeclared variables and more, [as documented](https://github.com/hashicorp/terraform-ls/blob/main/docs/validation.md#enhanced-validation).\n\n![](docs/validation-rule-missing-attribute.png)\n\n![](docs/validation-rule-invalid-ref.png)\n\nThe enhanced validation feature is enabled by default but can be disabled using the following setting:\n\n```json\n\"terraform.validation.enableEnhancedValidation\": false\n```\n\nThe extension also provides validation through [`terraform validate`](https://www.terraform.io/cli/commands/validate). This can be triggered via command palette. Unlike the other validation methods, this one requires the Terraform CLI installed and a previous successful run of `terraform init` (i.e. local installation of all providers and modules) to function correctly. It is the slowest method, but the most thorough - i.e. it will catch the most mistakes.\n\n![](docs/validation-cli-command.png)\n\n![](docs/validation-cli-diagnostic.png)\n\n### Syntax Highlighting\n\nTerraform syntax highlighting recognizes language constructs from Terraform version 0.12 to 1.X. Terraform providers, modules, variables and other high-level constructs are recognized, as well as more complex code statements like `for` loops, conditional expressions, and other complex expressions.\n\nTerraform Stacks syntax highlighting recognizes language constructs from Terraform version 1.9 to 1.X.\n\nTerraform Search syntax highlighting recognizes language constructs from Terraform version 1.14 to 1.X.\n\n![](docs/syntax.png)\n\nSome language constructs will highlight differently for older versions of Terraform that are incompatible with newer ways of expressing Terraform code. In these cases we lean toward ensuring the latest version of Terraform displays correctly and do our best with older versions.\n\n### Code Navigation\n\nWhile editing, you can right-click different identifiers in Terraform, Terraform Stacks and Terraform Search files to take advantage of several convenient commands:\n\n- `Go to Definition` (`F12`) navigates to the code that defines the construct where your cursor is. This command is helpful when you're working with Terraform modules and variables defined in other files than the currently opened document.\n- `Peek Definition` (`Alt+F12`) displays the relevant code snippet for the construct where your cursor is directly in the current editor instead of navigating to another file.\n- `Go to Declaration` navigates to the place where the variable or other construct is declared.\n- `Peek Declaration` displays the declaration directly inside the current editor.\n\n### Code Formatting\n\nThis extension utilizes [`terraform fmt`](https://www.terraform.io/cli/commands/fmt) to rewrite an open document to a canonical format and style. This command applies a subset of the [Terraform language style conventions](https://www.terraform.io/language/syntax/style), along with other minor adjustments for readability.\n\nThis works for Terraform, Terraform Stacks and Terraform Search files.\n\nSee the [Formatting](#formatting) Configuration section for information on how to configure this feature.\n\n### Code Snippets\n\nThe extension provides context aware snippets to accelerate adding Terraform code to your configuration files.\n\nCombined with `editor.suggest.preview` and `terraform.experimentalFeatures.prefillRequiredFields`, the extension can suggest completions for all Terraform language constructs.\n\n### HCP Terraform Integration\n\nEvery time you have to switch away from your code, you risk losing momentum and the context about your tasks. Previously, Terraform users needed to have at least two windows open – their editor and a web page – to develop Terraform code. The editor contains all of the Terraform code they are working on, and the web page has the HCP Terraform workspace loaded. Switching back and forth between the HCP Terraform website and the text editor can be a frustrating and fragmented experience.\n\nThe HCP Terraform Visual Studio Code integration improves user experience by allowing users to view workspaces directly from within Visual Studio Code. Users can view the status of current and past runs and inspect detailed logs – without ever leaving the comfort of their editor.\n\nTo start using HCP Terraform with VS Code, open the new HCP Terraform sidebar and click \"Login to HCP Terraform\". You can login using a stored token from the Terraform CLI, an existing token you provide, or open the HCP Terraform website to generate a new token.\n\n![](docs/tfc/login_view.gif)\n\nOnce logged in, you are prompted to choose which Organization to view workspaces in.\n\n![](docs/tfc/choose_org_view.png)\n\nNow that your Organization is chosen, the Workspace view populates with all workspaces your token has permission to view. At a glance, you can see the last run status of each Workspace. Hovering over a workspace shows detailed information about each workspace.\n\n![](docs/tfc/workspace_view.gif)\n\nSelecting a workspace populates the Run view with a list of runs for that workspace. At a glance, you can see the status of each Run, and hover over each for more detailed information.\n\n![](docs/tfc/workspace_run_view.gif)\n\nIf a Run has been Planned or Applied, you can view the raw log for each by expanding the Run then selecting the 'View Raw Log' button for either the Plan or Apply.\n\n![](docs/tfc/plan_apply_view.gif)\n\nTo sign out or log out of your HCP Terraform session, click the Accounts icon next to the Settings icon in the Activity Bar and select \"Sign Out\":\n\n![](docs/tfc/log_out.png)\n\nThis will clear the currently saved token and allow you to login using a different token.\n\n### Terraform Module and Provider Explorer\n\nList Terraform modules used in the current open document in the Explorer Pane, or drag to the Side Bar pane for an expanded view.\n\nEach item shows an icon indicating where the module comes from (local filesystem, git repository, or Terraform Registry).\n\n![](docs/module_calls.png)\n\nIf the module comes from the Terraform Registry, a link to open the documentation in a browser is provided.\n\n![](docs/module_calls_doc_link.png)\n\nList Terraform providers used in the current open document in the Explorer Pane, or drag to the Side Bar pane for an expanded view.\n\n![](docs/module_providers.png)\n\n### Terraform MCP Server Integration\n\nThe extension registers the [Terraform MCP Server](https://github.com/hashicorp/terraform-mcp-server), which provides advanced AI assistance capabilities for Terraform development through the Model Context Protocol (MCP). For a complete list of features and capabilities, please refer to the [official](https://github.com/hashicorp/terraform-mcp-server) Terraform MCP Server documentation.\n\nThe MCP server integration is disabled by default.\n\nYou can enable or disable this feature via:\n- The Command Palette: `HashiCorp Terraform: Enable MCP Server` or `HashiCorp Terraform: Disable MCP Server`\n- Settings: `terraform.mcp.server.enable`\n\n#### Container Runtime Configuration\n\nThe extension automatically detects available container runtimes on your system and uses them in the following priority order:\n\n1. **Docker** (preferred) - If Docker is installed and running\n2. **Podman** (fallback) - If Docker is not available but Podman is installed and running\n\n**Supported container runtimes:**\n- `docker` - Requires Docker to be installed and running\n- `podman` - Requires Podman to be installed and running\n\n**Note:** At least one supported container runtime (Docker or Podman) must be installed and running on your system before enabling the MCP server integration. If neither is available, the extension will show an error message with links to installation guides for both runtimes.\n\nWhen enabled, the MCP server runs as a container (`hashicorp/terraform-mcp-server`), providing your AI assistant with contextual knowledge about Terraform providers, modules, and best practices. The extension automatically manages the server lifecycle, starting it when needed for AI interactions.\n\n![](/docs/hashicorp-terraform-mcp-server.gif)\n\n### Terraform Commands\n\nThe extension provides access to several Terraform commands through the Command Palette:\n\n- Terraform: init\n- Terraform: init current folder\n- Terraform: validate\n- Terraform: plan\n\n## Requirements\n\nThe Terraform VS Code extension bundles the [Terraform Language Server](https://github.com/hashicorp/terraform-ls) and is a self-contained install.\n\nThe extension does require the following to be installed before use:\n\n- VS Code v1.86 or greater\n- Terraform v0.12 or greater\n\n## Platform Support\n\nThe extension should work anywhere VS Code itself and Terraform 0.12 or higher is supported. Our test matrix includes the following:\n\n- Windows Server 2022 with Terraform v1.6\n- macOS 12 with Terraform v1.6\n- macOS 11 with Terraform v1.6\n- Ubuntu 22.04 with Terraform v1.6\n\nIntellisense, error checking and other language features are supported for Terraform v0.12 and greater.\n\nSyntax highlighting targets Terraform v1.0 and greater. Highlighting 0.12-0.15 configuration is done on a best effort basis.\n\n## Usage\n\n### VS Code Workspace support\n\nIt is a common pattern to have separate folders containing related Terraform configuration that are not contained under one root folder. For example, you have a main Terraform folder containing the configuration for a single application and several module folders containing encapsulated code for configuring different parts of component pieces. You could open each folder in a separate VS Code window, and bounce between each window to author your changes.\n\nA better approach is to use [VS Code Workspaces](https://code.visualstudio.com/docs/editor/workspaces). Using our example above, open the main Terraform folder first, then use Add Folder to workspace to add the dependent module folders. A single VS Code window is used and all Terraform files are available to author your changes. This uses a single terraform-ls process that has an understanding of your entire project, allowing you to use features like `Go to Symbol` and `Reference counts` across your project.\n\n### Single file support\n\nOpening a single Terraform configuration file inside VS Code is currently not supported. We see this approach most commonly attempted by users of terminal editors like vim, where it is common to edit a single file at a time.\n\nThe Terraform VS Code extension works best when it has the full context of a Terraform project where it can parse the referenced files and provide the expected advanced language features.\n\nThe recommended workflow is to instead open the containing folder for the desired Terraform file inside a single VS Code editor window, then navigate to the desired file. This seems counter-intuitive when you only want to edit a single file, but this allows the extension to understand the Terraform setup you are using and provide accurate and helpful intellisense, error checking, and other language features.\n\n### Refresh Intellisense\n\nThe extension will pick up new schema for Terraform providers you reference in your configuration files automatically whenever anything changes inside `.terraform`.\n\nTo provide the extension with an up-to-date schema for the Terraform providers used in your configuration:\n\n1. Open any folder or VS Code workspace containing Terraform files. \n1. Open the Command Palette and run `Terraform: init current folder` or perform a `terraform init` from the terminal.\n\n### Remote Extension support\n\nThe Visual Studio Code [Remote - WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) lets you use the Windows Subsystem for Linux (WSL) as your full-time development environment right from VS Code. You can author Terraform configuration files in a Linux-based environment, use Linux-specific toolchains and utilities from the comfort of Windows.\n\nThe Remote WSL extension runs the [HashiCorp Extension](https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform) and other extensions directly in WSL so you can edit files located in WSL or the mounted Windows filesystem (for example /mnt/c) without worrying about pathing issues, binary compatibility, or other cross-OS challenges.\n\nFor a detailed walkthrough for how to get started using WSL and VS Code, see https://code.visualstudio.com/docs/remote/wsl-tutorial.\n\n## Configuration\n\nThe extension does not require any initial configuration and should work out of the box. To take advantage of additional VS Code features or experimental extension features you can configure settings to customize behavior.\n\nThis extension offers several configuration options. To modify these open the [VS Code Settings Editor](https://code.visualstudio.com/docs/getstarted/settings#_settings-editor) in the UI or JSON view for [user and workspace level](https://code.visualstudio.com/docs/getstarted/settings#_creating-user-and-workspace-settings) settings, [scope your settings by language](https://code.visualstudio.com/docs/getstarted/settings#_languagespecific-editor-settings), or alternatively modify the `.vscode/settings.json` file in the root of your working directory.\n\n### Code Completion\n\nAn experimental option can be enabled to prefill required fields when completing Terraform blocks with the following setting:\n\n```json\n\"terraform.experimentalFeatures.prefillRequiredFields\": true\n```\n\nFor example, choosing `aws_alb_listener` in the following block inserts a snippet in the current line with the `resource` block entirely filled out, containing tab stops to fill in the required values.\n\n![](docs/pre-fill.png)\n\nCombine this with `editor.suggest.preview` and the editor will provide inline snippet suggestions for blocks of code:\n\n![](docs/intellisense3.png)\n\nCompleting the snippet allows you to tab complete through each attribute and block.\n\n### Code Lens\n\nDisplay reference counts above top level blocks and attributes\n\n```json\n\"terraform.codelens.referenceCount\": true\n```\n\n![](docs/code_lens.png)\n\n\u003e **Note:** This feature impacts extension performance when opening folders with many modules present. If you experience slowness or high CPU utilization, open a smaller set of folders or disable this setting.\n\n### Formatting\n\nTo enable automatic formatting, it is recommended that the following be added to the extension settings for the Terraform extension:\n\n```json\n\"[terraform]\": {\n  \"editor.defaultFormatter\": \"hashicorp.terraform\",\n  \"editor.formatOnSave\": true,\n  \"editor.formatOnSaveMode\": \"file\"\n},\n\"[terraform-vars]\": {\n  \"editor.defaultFormatter\": \"hashicorp.terraform\",\n  \"editor.formatOnSave\": true,\n  \"editor.formatOnSaveMode\": \"file\"\n},\n\"[terraform-stack]\": {\n  \"editor.defaultFormatter\": \"hashicorp.terraform\",\n  \"editor.formatOnSave\": true,\n  \"editor.formatOnSaveMode\": \"file\"\n},\n\"[terraform-deploy]\": {\n  \"editor.defaultFormatter\": \"hashicorp.terraform\",\n  \"editor.formatOnSave\": true,\n  \"editor.formatOnSaveMode\": \"file\"\n},\n\"[terraform-test]\": {\n  \"editor.defaultFormatter\": \"hashicorp.terraform\",\n  \"editor.formatOnSave\": true,\n  \"editor.formatOnSaveMode\": \"file\"\n},\n\"[terraform-mock]\": {\n  \"editor.defaultFormatter\": \"hashicorp.terraform\",\n  \"editor.formatOnSave\": true,\n  \"editor.formatOnSaveMode\": \"file\"\n},\n\"[terraform-search]\": {\n  \"editor.defaultFormatter\": \"hashicorp.terraform\",\n  \"editor.formatOnSave\": true,\n  \"editor.formatOnSaveMode\": \"file\"\n}\n```\n\n\u003e It is recommended to set `editor.defaultFormatter` to ensure that VS Code knows which extension to use to format your files. It is possible to have more than one extension installed which claim a capability to format Terraform files.\n\nWhen using the `editor.formatOnSaveMode` setting, only `file` is currently supported. The `modifications` or `modificationsIfAvailable` settings [use the currently configured SCM](https://code.visualstudio.com/updates/v1_49#_only-format-modified-text) to detect file line ranges that have changed and send those ranges to the formatter. The `file` setting works because `terraform fmt` was originally designed for formatting an entire file, not ranges. If you don't have an SCM enabled for the files you are editing, `modifications` won't work at all. The `modificationsIfAvailable` setting will fall back to `file` if there is no SCM and will appear to work sometimes.\n\nIf you want to use `editor.codeActionsOnSave` with `editor.formatOnSave` to automatically format Terraform files, use the following configuration:\n\n```json\n\"editor.formatOnSave\": true,\n\"[terraform]\": {\n  \"editor.defaultFormatter\": \"hashicorp.terraform\",\n  \"editor.formatOnSave\": false,\n  \"editor.codeActionsOnSave\": {\n    \"source.formatAll.terraform\": true\n  },\n},\n\"[terraform-vars]\": {\n  \"editor.defaultFormatter\": \"hashicorp.terraform\",\n  \"editor.formatOnSave\": false,\n  \"editor.codeActionsOnSave\": {\n    \"source.formatAll.terraform\": true\n  },\n},\n\"[terraform-stack]\": {\n  \"editor.defaultFormatter\": \"hashicorp.terraform\",\n  \"editor.formatOnSave\": false,\n  \"editor.codeActionsOnSave\": {\n    \"source.formatAll.terraform\": true\n  },\n},\n\"[terraform-deploy]\": {\n  \"editor.defaultFormatter\": \"hashicorp.terraform\",\n  \"editor.formatOnSave\": false,\n  \"editor.codeActionsOnSave\": {\n    \"source.formatAll.terraform\": true\n  },\n},\n\"[terraform-test]\": {\n  \"editor.defaultFormatter\": \"hashicorp.terraform\",\n  \"editor.formatOnSave\": false,\n  \"editor.codeActionsOnSave\": {\n    \"source.formatAll.terraform\": true\n  },\n},\n\"[terraform-mock]\": {\n  \"editor.defaultFormatter\": \"hashicorp.terraform\",\n  \"editor.formatOnSave\": false,\n  \"editor.codeActionsOnSave\": {\n    \"source.formatAll.terraform\": true\n  },\n},\n\"[terraform-search]\": {\n  \"editor.defaultFormatter\": \"hashicorp.terraform\",\n  \"editor.formatOnSave\": false,\n  \"editor.codeActionsOnSave\": {\n    \"source.formatAll.terraform\": true\n  },\n}\n\n```\n\nThis will keep the global `editor.formatOnSave` for other languages you use, and configure the Terraform extension to only format during a `codeAction` sweep.\n\n\u003e **Note**: Ensure that the terraform binary is present in the environment `PATH` variable. If the terraform binary cannot be found, formatting will silently fail.\n\n### Validation\n\nAn experimental validate-on-save option can be enabled with the following setting:\n\n```json\n\"terraform.experimentalFeatures.validateOnSave\": true\n```\n\nThis will create diagnostics for any elements that fail validation. You can also run `terraform validate` by issuing the `Terraform: validate` in the command palette.\n\n### Multiple Workspaces\n\nIf you have multiple root modules in your workspace, you can configure the language server settings to identify them. Edit this through the VSCode Settings UI or add a `.vscode/settings.json` file using the following template:\n\n```json\n\"terraform.languageServer.rootModules\": [\n  \"/module1\",\n  \"/module2\"\n]\n```\n\nIf you want to automatically search root modules in your workspace and exclude some folders, you can configure the language server settings to identify them.\n\n```json\n\"terraform.languageServer.excludeRootModules\": [\n  \"/module3\",\n  \"/module4\"\n]\n```\n\nIf you want to automatically ignore certain directories when terraform-ls indexes files, add the folder names to this setting:\n\n```json\n \"terraform.languageServer.ignoreDirectoryNames\": [\n   \"folder1\",\n   \"folder2\"\n ]\n```\n\n### Terraform command options\n\nYou can configure the path to the Terraform binary used by terraform-ls to perform operations inside the editor by configuring this setting:\n\n```json\n\"terraform.languageServer.terraform.path\": \"C:/some/folder/path\"\n```\n\nYou can override the Terraform execution timeout by configuring this setting:\n\n```json\n\"terraform.languageServer.terraform.timeout\": \"30\"\n```\n\nYou can set the path Terraform logs (`TF_LOG_PATH`) by configuring this setting:\n\n```json\n\"terraform.languageServer.terraform.logFilePath\": \"C:/some/folder/path/log-{{varname}}.log\"\n```\n\nSupports variables (e.g. timestamp, pid, ppid) via Go template syntax `{{varname}}`\n\n### Telemetry\n\nWe use telemetry to send error reports to our team, so we can respond more effectively. You can configure VS Code to send all telemetry, just crash telemetry, just errors or turn it off entirely by [configuring](https://code.visualstudio.com/docs/getstarted/telemetry#_disable-telemetry-reporting) `\"telemetry.telemetryLevel\"` to your desired value. You can also [monitor what's being sent](https://code.visualstudio.com/docs/getstarted/telemetry#_output-channel-for-telemetry-events) in your logs.\n\n## Known Issues\n\n- If there are syntax errors present in the document upon opening, intellisense may not provide all completions. Run `Terraform: validate` and fix validation errors, then reload the document and intellisense will work again. Potential solutions for this are being investigated in See [hcl-lang#57](https://github.com/hashicorp/hcl-lang/issues/57) for more information.\n- Completion inside incomplete blocks, such as `resource \"here` (without the closing quote and braces) is not supported. You can complete the 1st level blocks though and that will automatically trigger subsequent completion for e.g. resource types. See [terraform-ls#57](https://github.com/hashicorp/terraform-ls/issues/57) for more information.\n- A number of different folder configurations (specifically when your root module is not a parent to any submodules) are not yet supported. More information available in ([terraform-ls#32](https://github.com/hashicorp/terraform-ls/issues/32#issuecomment-649707345))\n\n### Terraform 0.11 compatibility\n\nIf you are using a Terraform version prior to 0.12.0, you can install the pre-transfer 1.4.0 version of this extension by following the instructions in the [pin version section](#pin-to-a-specific-version-of-the-extension).\n\nThe configuration has changed from 1.4.0 to v2.X. If you are having issues with the Language Server starting, you can reset the configuration to the following:\n\n```json\n\"terraform.languageServer.enable\": true,\n\"terraform.languageServer.args\": [\"serve\"]\n```\n\n## Troubleshooting\n\n- If you have a question about how to accomplish something with the extension, please ask on the [Terraform Editor Discuss site](https://discuss.hashicorp.com/c/terraform-core/terraform-editor-integrations/46)\n- If you come across a problem with the extension, please file an [issue](https://github.com/hashicorp/vscode-terraform/issues/new/choose).\n- If someone has already filed an issue that encompasses your feedback, please leave a 👍/👎 reaction on the issue\n- Contributions are always welcome! Please see our [contributing guide](https://github.com/hashicorp/vscode-terraform/issues/new?assignees=\u0026labels=enhancement\u0026template=feature_request.md) for more details\n- If you're interested in the development of the extension, you can read about our [development process](DEVELOPMENT.md)\n\n### Settings Migration\n\nRead more about [changes in settings options introduced in v2.24.0](./docs/settings-migration.md).\n\n### Generate a bug report\n\nExperience a problem? You can have VS Code open a Github issue in our repo with all the information filled out for you. Open the Command Palette and invoke `Terraform: Generate Bug Report`. This will inspect the VS Code version, the Terraform extension version, the terraform-ls version and the list of installed extensions and open a browser window with GitHub loaded. You can then inspect the information provided, edit if desired, and submit the issue.\n\n### Reload the extension\n\nIf you haven't seen the Problems Pane update in awhile, or hover and intellisense doesn't seem to showing up, you might not know what to do. Sometimes the Terraform extension can experience problems which cause the editor to not respond. The extension has a way of [reporting the problem](#generate-a-bug-report), but there is something you can do to get right back to working after reporting the problem: reload the Terraform extension.\n\nYou can reload the Terraform extension by opening the command palette and starting to type `Reload`. A list of commands will appear, select `Reload Window`. This will reload the Visual Studio Code window without closing down the entire editor, and without losing any work currently open in the editor.\n\n### Pin to a specific version of the extension\n\nIf you wish to install a specific version of the extension, you can choose 'Install Another version' option in the Extensions pane. This will bring up a list of prior versions for the selected extension. Choose the version you want to install from the list.\n\n![](docs/pin_version.png)\n\n## Code of Conduct\n\nHashiCorp Community Guidelines apply to you when interacting with the community here on GitHub and contributing code to this repository.\n\nPlease read the full text at https://www.hashicorp.com/community-guidelines\n\n## Contributing\n\nWe are an open source project on GitHub and would enjoy your contributions! Consult our [development guide](DEVELOPMENT.md) for steps on how to get started. Please [open a new issue](https://github.com/hashicorp/vscode-terraform/issues) before working on a PR that requires significant effort. This will allow us to make sure the work is in line with the project's goals.\n\n## Release History\n\n**v2.0.0** is the first official release from HashiCorp, prior releases were by [Mikael Olenfalk](https://github.com/mauve).\n\nThe 2.0.0 release integrates a new [Language Server package from HashiCorp](https://github.com/hashicorp/terraform-ls). The extension will install and upgrade terraform-ls to continue to add new functionality around code completion and formatting. See the [terraform-ls CHANGELOG](https://github.com/hashicorp/terraform-ls/blob/main/CHANGELOG.md) for details.\n\nIn addition, this new version brings the syntax highlighting up to date with all HCL2 features, as needed for Terraform 0.12 and above.\n\n\u003e **Configuration Changes** Please note that in 2.x, the configuration differs from 1.4.0, see [Known Issues](#known-issues) for more information.\n\nSee the [CHANGELOG](https://github.com/hashicorp/vscode-terraform/blob/main/CHANGELOG.md) for more detailed release notes.\n\n## Credits\n\n- [Mikael Olenfalk](https://github.com/mauve) - creating and supporting the [vscode-terraform](https://github.com/mauve/vscode-terraform) extension, which was used as a starting point and inspiration for this extension.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fvscode-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashicorp%2Fvscode-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fvscode-terraform/lists"}