Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
HashiCorp · Terraform 004

Projects, governance, and collaboration

Terraform 004 · Lesson 18 of 18 · 2:12:12

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the HashiCorp Terraform Associate (004) exam. In this lesson: projects and teams, variable sets and run triggers, Sentinel and OPA policies and their enforcement levels, run tasks, health checks with drift detection, and the private registry of HCP Terraform. Includes three original practice questions, with Bluefin Logistics, a fictional parcel delivery company, as the example.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

A dozen workspaces

Bluefin now has a dozen workspaces in HCP Terraform, and new teams keep asking for access. The security team wants rules that stop risky changes, and the platform team wants to share credentials and modules without copying them. This lesson covers how HCP Terraform organizes workspaces, shares values between them, and governs every change.

Projects and teams

Projects group related workspaces, for example by business unit, by team, or by service. Every workspace belongs to exactly one project, and new workspaces go to the Default Project, which you can rename but not delete. Teams group users, and an organization grants them permissions on projects and workspaces: to start runs, to manage variables, or to read and write state. Every organization also has an owners team, which manages the whole organization. So instead of adding a team to each workspace, you grant it access to the entire project.

Variable sets and run triggers

A variable set shares Terraform and environment variables, like provider credentials, across many workspaces, and it belongs to the organization or to a project. It can apply globally, to whole projects, or to chosen workspaces, and a workspace variable with the same key overwrites the value of the set, unless the set is a priority variable set. Run triggers connect workspaces: when an apply succeeds in a source workspace, a run is queued in the connected workspace, with up to twenty sources per workspace. The connected workspace then reads the outputs of the source with the T F E outputs data source, which HashiCorp recommends, or with terraform remote state.

Policies

Policies check every plan against your rules, before the apply. HCP Terraform supports Sentinel, the policy as code framework of HashiCorp, Open Policy Agent, with its Rego language, and a newer native framework written in HCL. Policies are grouped into policy sets, and each set has a scope that decides which workspaces it checks. A Sentinel policy has an enforcement level: advisory only warns, soft mandatory stops the run until a user with permission overrides it, and hard mandatory stops the run, with no override. Run tasks send the run to other tools, like security scanners, and a mandatory task that fails stops the run, while an advisory one only warns.

Health and the registry

Health assessments run in the background, in the Standard and Premium editions. Drift detection checks whether the real infrastructure still matches the configuration, and continuous validation checks whether the check blocks and custom conditions still pass after the apply. The private registry shares the modules and providers of your organization, with their versions, and it can sync recommended public ones, while no-code provisioning lets users deploy a module without writing any Terraform. Dynamic provider credentials replace long-lived keys: for each run, HCP Terraform issues an OpenID Connect token, and your cloud platform exchanges it for temporary credentials. The explorer shows the workspaces, modules, providers, and Terraform versions across the organization, and cost estimation shows the monthly cost of a plan for supported resources.

Recap

Let's recap. Projects group workspaces, each workspace sits in exactly one project, and teams get their permissions on projects and workspaces. Variable sets share variables across workspaces, unless a workspace overwrites them, and run triggers queue a run after a successful apply in a source workspace. Sentinel and OPA policy sets check each plan, with advisory, soft mandatory, and hard mandatory levels for Sentinel. And drift detection, continuous validation, the private registry, and dynamic credentials keep the whole estate healthy and safe.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. Bluefin's billing team needs the same access to its six workspaces, and to every billing workspace created later. What is the simplest setup?

    • Grant the team access to each workspace
    • Group them in a project, and grant access to it
    • Add the team members to the owners team
    • Create a variable set for the billing team
    Show the answer

    Group them in a project, and grant access to it

    A project groups the billing workspaces, and the team gets access to the entire project, new workspaces included. “Grant the team access to each workspace” is wrong, because access set workspace by workspace must be repeated for every new workspace. “Add the team members to the owners team” is wrong, because the owners team manages the whole organization, far more than the billing team needs. And “Create a variable set for the billing team” is wrong, because a variable set shares variables, not permissions.

  2. Bluefin's security team writes a Sentinel policy that blocks public buckets, and no one, not even an administrator, may bypass it. Which enforcement level fits?

    • Advisory
    • Soft-mandatory
    • Hard-mandatory
    • A priority variable set
    Show the answer

    Hard-mandatory

    A failed hard mandatory policy stops the run, and no one can override it. “Advisory” is wrong, because an advisory policy only shows a warning, and the run goes on. “Soft-mandatory” is wrong, because a user with permission to manage policy overrides can let a soft mandatory failure through. And “A priority variable set” is wrong, because a priority variable set only fixes the values of variables, and it cannot block a bucket.

  3. Someone changes a security group in the AWS console, outside Terraform. Bluefin wants HCP Terraform to flag such changes without anyone running a plan. Which feature does this?

    • Drift detection, in the health assessments
    • A run trigger on the workspace
    • A soft-mandatory Sentinel policy
    • Dynamic provider credentials
    Show the answer

    Drift detection, in the health assessments

    Drift detection compares the real infrastructure with the configuration on a schedule, and flags the workspace when they differ. “A run trigger on the workspace” is wrong, because a run trigger starts a run after an apply in another workspace, not after a change in the console. “A soft-mandatory Sentinel policy” is wrong, because a policy only checks the plan of a run, and no one ran a plan. And “Dynamic provider credentials” is wrong, because dynamic credentials only replace long-lived keys for runs.