Domain 8 of 8 · Chapter 3 of 4

Organizing HCP Terraform Workspaces and Projects

Unlock the complete study guide + 1,040 practice questions across 16 full exams.

Bundled into the existing HashiCorp Certified: Terraform Associate premium course — no separate purchase.

14-day money-back guarantee — no questions asked.

Included in this chapter:

  • Organizations, projects, and workspaces
  • HCP workspaces are not CLI workspaces
  • Workspace settings: execution mode and apply
  • Locking and state history
  • Sharing outputs and chaining workspaces
  • How the exam tests workspace organization

HCP Terraform workspace vs Terraform CLI workspace

AspectHCP Terraform workspaceTerraform CLI workspace
What it isA separate managed environment in an organizationAn alternate named state within one working directory
ConfigurationIts own configuration, from VCS, CLI, or APIShares the directory's single configuration
StateOwn remote state with retained version historyA distinct state file sharing the directory's backend
Variables and runsOwn workspace variables and full run historyNone of its own; shares the directory's setup
IsolationFully isolated from other workspacesNon-overlapping resources, same config and backend
How selectedNamed in the cloud block, backend, or the UIChosen with terraform workspace select NAME

Decision tree

YesNoYesNoYesNoRead another workspace's outputs?Running on HCP Terraform?Run B after A applies?tfe_outputsoutputs only, secureterraform_remote_stateneeds full state accessRun triggerqueues a runKeep independent

Cheat sheet

  • HCP workspaces differ from CLI workspaces
  • Each workspace owns its state, variables, and runs
  • Workspaces keep historical state versions
  • Execution mode and apply method are per-workspace
  • Locking a workspace blocks applies
  • Workspaces share data through outputs
  • terraform_remote_state data source
  • HCP Terraform run triggers
  • Projects are folders that group workspaces
  • Permissions can be granted at the project level
  • New workspaces land in the Default Project

Unlock with Premium — includes all practice exams and the complete study guide.

References

  1. HCP Terraform workspaces overview
  2. Manage projects in HCP Terraform
  3. Terraform CLI workspaces
  4. HCP Terraform workspace settings
  5. The terraform_remote_state data source
  6. tfe_outputs data source (HCP Terraform provider)
  7. HCP Terraform run triggers