This lesson is presented for educational purposes (Terraform Associate exam preparation) and is not intended as marketing material.
- HCP stands for HashiCorp Cloud Platform.
- HCP Terraform is a hosted, managed service that enables teams to use Terraform to provision infrastructure while adding collaboration, remote state management, and workflow automation.
- HCP Terraform does not replace the Terraform language or providers. You still author the same Terraform configurations — what changes is where runs occur and how teams coordinate around them.
- Secure remote state storage (encrypted at rest, locking, versioned state).
- Team collaboration (shared workspaces, role-based access control, audit logs).
- Remote execution (consistent cloud-based plan/apply runs with controlled environments).
- Governance and policy enforcement (native Sentinel support; integrations with tools like OPA are also possible).

terraform apply — and drift detection, which alerts you when infrastructure diverges from Terraform-managed configuration.
How HCP Terraform relates to the Terraform CLI
HCP Terraform extends the Terraform CLI experience rather than replacing it. Your existing workflow, providers, modules, and language syntax remain unchanged; HCP adds platform services that centralize and standardize collaboration and execution.
Feature comparison
| Feature area | Terraform CLI (local/community) | HCP Terraform (managed) |
|---|---|---|
| State storage | Local terraform.tfstate or custom backends | Managed, encrypted remote state with locking |
| Execution | Local runs (machine-specific) | Remote execution in a consistent environment (recommended) |
| Collaboration | File sharing, CI/CD integration | Workspaces, RBAC, run visibility, audit logs |
| Policy & governance | Local/CI checks, ad-hoc tools | Policy enforcement (Sentinel, OPA integrations) |
| Cost visibility | Third-party tools or manual | Built-in cost estimation |
| Module sharing | Public/Private registries manually managed | Private module registry and governance controls |

- No need to rewrite Terraform configurations. Resource blocks, data sources, modules, and provider usage remain the same.
- Existing CLI workflows, VCS integration, and CI/CD pipelines continue to work.
- You gain centralized state, audit logging, and RBAC while keeping established processes.
- Adoption can be incremental — start with managed state, then enable remote execution and policy controls when ready.

-
Write
- Author Terraform configuration (TF files), variable files, and modules locally.
- Commit changes to VCS.
-
Plan
- With remote execution,
terraform planis executed in HCP’s environment. The platform evaluates the configuration and sends the plan output back to your CLI for review and collaboration.
- With remote execution,
-
Apply
terraform applyruns remotely (when remote execution is enabled). HCP provisions resources and stores state in the workspace — no localterraform.tfstatefile is required.
-
Remote execution (recommended for teams)
- Plans and applies run in HCP-managed infrastructure.
- Enables policy enforcement, cost estimates, run visibility, and audit trails.
- Run output streams to your CLI for real-time feedback.
-
Local execution
- Your machine runs plans/applies while state is stored in HCP.
- Useful for providers requiring local resources, local file access, or staged migration.
- Local execution may not trigger all HCP platform features (for example, some policy checks).

- Consistent execution environments and Terraform versions across the team.
- Eliminates “works on my machine” problems caused by local environment differences.
- Runs can continue in HCP even if your laptop disconnects or fails.
- Centralized logs and run metadata improve auditing and troubleshooting.
cloud block to the top-level terraform configuration:
organizationis the HCP organization name you create in the HCP Terraform dashboard.workspaces.nameselects the workspace where state, variables, and run history are stored.hostnamedefaults toapp.terraform.iofor Terraform Cloud; some HCP deployments may use a different hostname.- Use
terraform loginto authenticate your CLI to HCP Terraform before running remote plans/applies.
Tip: If you plan a gradual migration, start by using HCP only for managed state (local execution), then enable remote execution once your team is ready. Always run
terraform login to store HCP credentials for CLI access.| Tier | Best for | Key features |
|---|---|---|
| Free | Learning, small projects | Managed state, basic workspace features, up to 500 resources (subject to change) |
| Essentials | Small teams | Additional team features, more runs, basic collaboration |
| Standard | Production teams | Drift detection, audit events, policy enforcement (Sentinel), golden patterns |
| Premium | Large enterprises | Private VCS, run tasks, advanced governance and enterprise features |
- Sign up for HCP Terraform: visit
https://app.terraform.io/and create a free account. - Create an organization and one or more workspaces in the HCP dashboard.
- Authenticate your CLI: run
terraform loginand follow the prompts. - Add the
cloudblock to your Terraform configuration (see example above). - Commit your configuration to VCS and trigger a run (via CLI or VCS integration) to start using managed state and remote execution.
- HCP Terraform is a managed platform that extends, not replaces, Terraform CLI.
- Your Terraform code, providers, and modules remain unchanged; HCP changes where plan/apply runs and where state is stored.
- Remote execution is recommended for consistent team workflows; local execution with remote state is supported for special cases or migration.
- Adoption is incremental — start with managed state, add remote execution, then enable policy and governance.
- Authenticate with HCP using
terraform login. - Configure the
cloudblock and workspaces in detail. - Connect local Terraform to HCP and run example plans/applies.
- Explore Sentinel policies or OPA integrations for governance and compliance.