Skip to main content

Create a workspace

A workspace is a named environment that stores Terraform configurations, variables, states, and other resources necessary to manage infrastructure. Each Workspace is mapped to a single state.

Users can define a Terraform configuration with multiple workspaces to enforce the same desired configuration. Each workspace creates a different state with its own independent lifecycle.

For example, you can have a single configuration of a Kubernetes cluster and create multiple workspaces out of it, each leading to different clusters. The configuration is unique to each workspace and can be managed through environment or Terraform variables.

Workspace statuses

A workspace can have one of the following statuses:

  • Active: Successfully deployed and running.
  • Inactive: Successfully destroyed or was not provisioned.
  • Drifted: Drift was detected.
  • Provisioning: Currently being provisioned.
  • Destroying: Currently being destroyed.
  • Failed: Errors were encountered during provisioning or destroying.
  • Unknown: Changes were made outside the product.

Go to workspace statuses to find out more about filtering workspace by status.

Create a new workspace

pending release

The new workspace wizard is currently pending release and will be available soon!


If you need to use either environment or Terraform variables during execution, select the Variables tab to define the variables.

  • Environment Variables can be either String, Secret, or a reference to another variable using JEXL expression (it can be in the same or a different workspace or from the pipeline).
  • Terraform Variables Can be provided in the following ways:
  • Inline Users can define Terraform variables within the workspace. Variables can be either String, hcl, Secret, or a reference to another variable, using JEXL expression (can be in the same or a different workspace, or from the pipeline).
  • From Git Repo (Implicit) Users can store .tfvar in the same folder as the Terraform code for the workspace.
  • From Git Repo (Explicit) Users can define a specific folder for .tfvar files (which can be different from the Terraform code's location). These files can be in the same or different repository as the Terraform code.
tfvar jexl support

JEXL expressions cannot be used to reference tfvar files.

The values defined in line with the workspace will take precedence over the git configuration.

Workspace variables

Clone a workspace

Harness supports workspace cloning for quick setup of new workspaces with the same or similar configuration as existing workspaces.

Go to provision workspace to learn how to provision workspaces.