Separate HCP Terraform projects, workspaces and runs
Decide where state, run inputs, permissions and policy checks belong in a collaborative workflow.
Separate HCP Terraform projects, workspaces and runs
An HCP Terraform workspace holds a particular configuration context, state, variables and run history. Projects group related workspaces and can support delegated team access. Separate environments that need independent state, approval or credentials. CLI workspaces in a local backend are a different feature. Specify the organization and intended HCP Terraform workspace when connecting a CLI workflow.
A VCS-connected workspace can produce a speculative plan for a pull request and a normal run after a qualifying merge. Use variable sets for genuinely shared values, and scope sensitive values to their consumers. Dynamic provider credentials can reduce reliance on long-lived cloud keys. Apply permissions, policy checks and run history to govern changes. Choose an execution mode and agent connectivity that can reach the authorized target.
Worked case 1
A production team needs its own state and run approvals but shares naming settings with staging. How could HCP Terraform represent that?
Check your reasoning
Use separate workspaces for the independent environments. Scope a variable set to the relevant workspaces and grant production apply rights to the appropriate team.
Worked case 2
A speculative plan succeeded in a pull request. Has the production infrastructure changed?
Check your reasoning
A speculative plan previews the effect and cannot itself be applied. Inspect the normal run tied to the merged revision and its policy and approval state before declaring a deployment complete.
HashiCorp objective references: 8a–8d.
HCP Terraform workspaces · Official Terraform 004 objectives for this domain
Related lesson in GitHub Administration. Trace a person's effective access.
Practice with the recording
Several HCP Terraform workspaces consume one shared value, and staging needs an exception. What should the owner inspect?
Check your reasoning
List applicable variable sets, their scopes and priority settings, then compare the staging workspace variable. A priority variable set can change the expected precedence. Confirm the resolved input in a plan without exposing sensitive values.
sthithapragna · Terraform Associate 004 full course · 5:12:28
Apply the current exam objectives
Two workspaces can use identical configuration and still govern separate infrastructure because each owns its state. Before triggering a downstream run, confirm that the upstream run applied, that the downstream workspace can access only its intended outputs and that sensitive values are handled appropriately.
Practice the individual exam skills
- 8a–8d Connect a VCS repository to an HCP Terraform workspace, inspect a speculative plan and identify who can approve an apply. Group workspaces in a project and compare workspace inputs with variable sets. Verify the run used the intended credentials and state.
Separate HCP Terraform projects, workspaces and runs quiz
Answer 3 questions. Check each answer for an explanation.