Skip to content

HCP Terraform and Remote Collaboration


A remote backend solves an important problem: shared state. CI/CD solves another: repeatable execution. But once a team wants centralized runs, permissions, state, variables, VCS integration, and collaboration around those runs, it is useful to have a platform that brings those pieces together.

That is the role HCP Terraform.

What Is HCP Terraform?

HCP Terraform is HashiCorp’s managed platform for collaborative Terraform workflows.

Terraform itself is still the infrastructure-as-code engine.

HCP Terraform adds an operational platform around it.

A useful distinction is:

Terraform
    β”‚
    └── infrastructure-as-code engine

HCP Terraform
    β”‚
    β”œβ”€β”€ state
    β”œβ”€β”€ runs
    β”œβ”€β”€ workspaces
    β”œβ”€β”€ variables
    β”œβ”€β”€ permissions
    β”œβ”€β”€ VCS integration
    └── collaboration

HCP Terraform workspaces represent managed collections of infrastructure and can store state, variables, runs, and access-control settings. Remote execution can run Terraform on HCP Terraform’s disposable infrastructure.

HCP Terraform is therefore not a replacement for the Terraform language or CLI.

It is a managed way to operate Terraform.

Terraform CLI Versus HCP Terraform

With the CLI alone, you might have:

Developer laptop
      β”‚
      β–Ό
Terraform CLI
      β”‚
      β–Ό
S3 backend
      β”‚
      β–Ό
Infrastructure

With HCP Terraform:

Developer / Git
      β”‚
      β–Ό
HCP Terraform
      β”‚
      β”œβ”€β”€ State
      β”œβ”€β”€ Runs
      β”œβ”€β”€ Variables
      β”œβ”€β”€ Permissions
      └── Terraform execution
              β”‚
              β–Ό
        Infrastructure

The important change is where the operational control lives.

Instead of each engineer deciding how to execute Terraform, HCP Terraform provides a centralized system for managing runs and access.

HCP Terraform Workspaces

Do not confuse HCP Terraform workspaces with Terraform CLI workspaces.

A CLI workspace isolates multiple state files within one local Terraform working directory.

An HCP Terraform workspace is a managed infrastructure collection.

HashiCorp describes HCP Terraform workspaces as required for managing infrastructure in HCP Terraform. They also form a major part of the service’s permissions model.

A conceptual example:

HCP Terraform Organization
β”‚
β”œβ”€β”€ development-network
β”œβ”€β”€ staging-network
β”œβ”€β”€ production-network
β”œβ”€β”€ development-application
└── production-application

Each workspace has its own state.

Remote State

Each HCP Terraform workspace has separate state data.

In remote execution mode, HCP Terraform automatically configures Terraform to use the workspace’s state, so you do not need to configure a traditional backend in the same way you would for S3.

This gives you:

Workspace
   β”‚
   β”œβ”€β”€ Configuration
   β”œβ”€β”€ Variables
   β”œβ”€β”€ State
   β”œβ”€β”€ Runs
   └── Permissions

That grouping is one of the major reasons HCP Terraform can simplify team operations.

Remote Execution

With local Terraform:

Your laptop
   β”‚
   β”œβ”€β”€ Terraform binary
   β”œβ”€β”€ provider plugins
   β”œβ”€β”€ credentials
   └── execution

With remote execution:

Your laptop / Git
       β”‚
       β–Ό
HCP Terraform
       β”‚
       β–Ό
Disposable execution environment
       β”‚
       β–Ό
Cloud provider

For workspaces using remote execution, HCP Terraform performs Terraform runs on its own disposable virtual machines. That provides a consistent execution environment. It also means the laptop is no longer the machine that actually performs the production apply.

The Collaboration Workflow

A common workflow looks like:

Git Repository
      β”‚
      β–Ό
HCP Terraform
      β”‚
 β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”
 β–Ό         β–Ό
Plan      State
 β”‚
 β–Ό
Review
 β”‚
 β–Ό
Approval
 β”‚
 β–Ό
Apply
 β”‚
 β–Ό
Infrastructure

This changes the experience for the team.

A developer can create a pull request.

HCP Terraform can create a run associated with the change.

The team can inspect the plan.

An authorized person can approve the run.

The apply happens in the controlled execution environment.

The state remains associated with the workspace.

VCS Integration

HCP Terraform workspaces can connect to version-control repositories containing Terraform configuration.

Conceptually:

Developer
    β”‚
    β–Ό
Git Push
    β”‚
    β–Ό
VCS Repository
    β”‚
    β–Ό
HCP Terraform Workspace
    β”‚
    β–Ό
Terraform Plan

This means the Git repository remains the source of Terraform configuration while HCP Terraform becomes the execution and collaboration layer.

That is an important separation.

Git
 β”‚
 └── "What code should run?"

HCP Terraform
 β”‚
 └── "How and by whom should it run?"

State
 β”‚
 └── "What does Terraform currently manage?"

Variables and Variable Sets

Terraform needs variables.

In a local workflow, you might use:

terraform.tfvars
TF_VAR_...

In HCP Terraform, variables can be associated with workspaces and organizations can use variable sets to share common variables across multiple workspaces.

This is particularly useful when several workspaces share configuration such as:

AWS region
Common tags
Organization-specific settings
Provider authentication inputs

Variable sets reduce repetition.

But shared variables should not become a dumping ground.

The same least-privilege principle applies to secrets and credentials.

Permissions and Teams

A production Terraform system needs more than “everyone can apply.”

HCP Terraform provides teams and workspace-level access controls.

Teams can be given different levels of access to workspaces, including roles such as:

Read
Plan
Write
Admin

and more granular permissions are available.

A conceptual organizational model might be:

Platform Team
   β”‚
   β”œβ”€β”€ Admin production networking
   └── Admin shared infrastructure

Application Team
   β”‚
   β”œβ”€β”€ Plan production application
   └── Write development application

Developers
   β”‚
   └── Read production

The exact permissions should match your organization.

The principle is:

Permissions should follow responsibility.

Projects and Workspace Organization

As an organization grows, you may have many workspaces.

HCP Terraform provides projects for grouping workspaces and scoping permissions.

For example:

Projects
β”‚
β”œβ”€β”€ Platform
β”‚   β”œβ”€β”€ production-network
β”‚   └── shared-services
β”‚
β”œβ”€β”€ Payments
β”‚   β”œβ”€β”€ production
β”‚   └── staging
β”‚
└── Internal Tools
    β”œβ”€β”€ production
    └── development

This can make ownership and access boundaries easier to reason about.

Run History

A manually executed Terraform command leaves much of the operational context on the machine that ran it.

A centralized service can provide a history of runs:

Run 104
  β”‚
  β”œβ”€β”€ configuration version
  β”œβ”€β”€ plan
  β”œβ”€β”€ approval
  β”œβ”€β”€ apply
  └── result

Run 105
  β”‚
  └── ...

This helps answer questions such as:

  • What changed?
  • Which run applied it?
  • When did it happen?
  • What was the plan?
  • Who approved the operation?
  • Did it succeed?

Auditability is one of the biggest benefits of centralized Terraform operations.

Private Module Registry

Teams often build reusable Terraform modules.

Earlier in the course, you learned that modules can come from different sources.

HCP Terraform also provides a private module registry for organizations.

That gives a team a controlled place to publish and consume reusable internal modules.

Conceptually:

Platform Team
     β”‚
     β–Ό
Private Module Registry
     β”‚
 β”Œβ”€β”€β”€β”΄β”€β”€β”€β”€β”
 β–Ό        β–Ό
App A    App B

This can help standardize infrastructure patterns without forcing every team to copy module source into its own repository.

Remote State Sharing

Sometimes one Terraform configuration needs information managed by another.

HCP Terraform supports controlled state sharing between workspaces. Its configuration can restrict which workspaces are allowed to access another workspace’s state.

That creates a useful boundary:

Network Workspace
       β”‚
       β”‚ selected outputs
       β–Ό
Application Workspace

Rather than giving every workspace unrestricted access to every other workspace’s state, access can be deliberately scoped.

Remember that state can contain sensitive information.

State sharing is therefore an access-control decision, not just a convenience feature.

Remote Versus Local Execution

HCP Terraform supports different execution modes.

The important conceptual distinction is:

Remote

HCP Terraform performs the Terraform operations.

HCP Terraform
      β”‚
      └── Terraform run

Local

Your machine performs the Terraform operations while HCP Terraform can still provide state storage and related services.

Agent

An HCP Terraform agent can execute runs in infrastructure you control, which is useful when Terraform needs access to private networks or isolated infrastructure.

Current HCP Terraform documentation identifies Remote, Local, and Agent execution modes.

The choice depends on where Terraform needs to run and what network or operational constraints exist.

HCP Terraform Does Not Remove Terraform Concepts

It is easy to think:

“If I use HCP Terraform, I don’t need to understand state, plans, providers, or Terraform CLI behavior.”

That is backwards.

HCP Terraform makes those concepts more operationally manageable.

You still need to understand:

  • Terraform configuration
  • State
  • Providers
  • Resources
  • Modules
  • Plans
  • Applies
  • Dependencies
  • Authentication
  • Permissions

The platform does not remove Terraform’s execution model.

It organizes it.

HCP Terraform Versus S3 + CI

You do not automatically need HCP Terraform.

A team can build a strong workflow with:

Git
 +
CI/CD
 +
S3 backend
 +
S3 locking
 +
IAM

That can be a perfectly reasonable architecture.

HCP Terraform becomes attractive when you want more of the collaboration layer managed for you:

S3 + CI
   β”‚
   β”œβ”€β”€ You assemble the pieces
   β”œβ”€β”€ You maintain CI workflows
   β”œβ”€β”€ You manage state infrastructure
   └── You build approval conventions

HCP Terraform
   β”‚
   β”œβ”€β”€ Managed state
   β”œβ”€β”€ Managed runs
   β”œβ”€β”€ Workspace permissions
   β”œβ”€β”€ VCS integration
   β”œβ”€β”€ Variable management
   └── Collaboration UI

The trade-off is that you are adopting a managed platform and its operational model.

A Complete Mental Model for Team Terraform

At the end of this section, think of the entire system as several cooperating layers:

                    Git
                     β”‚
              Terraform Code
                     β”‚
                     β–Ό
              Execution System
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚                β”‚
          CI/CD         HCP Terraform
             β”‚                β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β–Ό
               Terraform Run
                     β”‚
                     β–Ό
              Remote State
                     β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”
              β–Ό             β–Ό
           Locking       Access Control
              β”‚             β”‚
              β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                     β–Ό
              Cloud Provider
                     β”‚
                     β–Ό
              Infrastructure

Each layer solves a different problem.

Git manages configuration history.

Terraform describes and changes infrastructure.

The backend or HCP Terraform manages state.

Locking coordinates concurrent writers.

CI/CD or HCP Terraform controls execution.

IAM and platform permissions control who can perform operations.

The cloud provider hosts the actual infrastructure.

The Core Lesson of Team Terraform

Terraform changes character when the only person running it is no longer you.

A local workflow can look like:

Edit
  β”‚
  β–Ό
terraform apply
  β”‚
  β–Ό
Infrastructure

A team workflow looks more like:

Configuration
     β”‚
     β–Ό
Git
     β”‚
     β–Ό
Review
     β”‚
     β–Ό
Plan
     β”‚
     β–Ό
Approval
     β”‚
     β–Ό
Controlled Apply
     β”‚
     β–Ό
Shared State
     β”‚
     β–Ό
Infrastructure

The additional machinery is not bureaucracy for its own sake.

It exists because infrastructure has become shared.

A shared state file needs protection.

A production change needs coordination.

A cloud credential needs controlled access.

A plan needs review.

An apply needs an accountable execution path.

That is the central idea behind team Terraform.

Section 4 Complete

You started this section with Terraform running on a laptop:

Terraform on my laptop

You can now reason about the complete team-oriented model:

                  Git
                   β”‚
             Configuration
                   β”‚
                   β–Ό
          Terraform Execution
                   β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”
          β–Ό                 β–Ό
       Plan/Review       Credentials
          β”‚                 β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β–Ό
             Remote Backend
                   β”‚
             β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”
             β–Ό           β–Ό
          State        Locking
             β”‚
             β–Ό
      Cloud Infrastructure

And, when a managed collaboration platform is appropriate:

Git
 β”‚
 β–Ό
HCP Terraform
 β”‚
 β”œβ”€β”€ Workspaces
 β”œβ”€β”€ State
 β”œβ”€β”€ Runs
 β”œβ”€β”€ Variables
 β”œβ”€β”€ Permissions
 └── Remote Execution
 β”‚
 β–Ό
Infrastructure

Terraform itself did not become a different language.

The surrounding operational system became more disciplined.

That is what makes Terraform suitable for teams: not merely reusable configuration, but controlled state, coordinated changes, protected credentials, reviewable plans, and accountable execution.

Last updated on