Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Terraform Workspace ManagerNew to Visual Studio Code? Get it now.
Terraform Workspace Manager

Terraform Workspace Manager

Terraform Workspace Manager

|
1 install
| (0) | Free
Switch between Terraform workspaces (dev/staging/prod state environments) across your root modules — from the status bar and a sidebar tree.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Terraform Workspace Manager

A VS Code extension to discover Terraform root modules in your project and manage their terraform workspace state environments — without leaving the editor.

Features

  • Root-module discovery — scans the open folder for directories containing .tf files and treats each as a switchable root module.
  • Status bar indicator — shows <module>: <workspace> for the active root module. Click it to switch workspaces via a quick pick.
  • Tree view sidebar — a "Terraform Workspaces" activity-bar view listing every root module with its workspaces nested underneath. The active module and current workspace are highlighted.
  • Workspace operations — select, create, and delete workspaces with inline actions. Deleting a workspace with non-empty state prompts before force-deleting.

Requirements

  • The terraform CLI on your PATH (or set terraformWorkspaceManager.terraformPath).
  • Each root module should be initialized (terraform init) so terraform workspace commands succeed.

Settings

Setting Default Description
terraformWorkspaceManager.terraformPath terraform Path to the terraform executable.
terraformWorkspaceManager.excludeGlobs ["**/.terraform/**", "**/node_modules/**", "**/.git/**"] Globs excluded during root-module discovery.

Commands

  • Terraform: Refresh Root Modules
  • Terraform: Select Active Root Module
  • Terraform: Switch Workspace
  • Terraform: New Workspace
  • Terraform: Delete Workspace

Developing

npm install
npm run compile      # or: npm run watch

Press F5 in VS Code to launch the Extension Development Host.

How it works

The extension shells out to terraform workspace {list,select,new,delete} in the active root module's directory. The active module is persisted per-workspace in workspaceState, so your selection survives reloads.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft