VS Code Extensions
Terraform Workspace Manager

Terraform Workspace Manager

by tf-workspace-manager

Switch between Terraform workspaces (dev/staging/prod state environments) across your root modules — from the status bar and a sidebar tree.

Downloads

5

Rating

— (0)

Version

0.1.1

Last updated

Jul 22, 2026

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.

Related extensions