We have seen two ways to automate Terraform: a generic pipeline (GitHub Actions) and a specialized tool that you host yourself (Atlantis). There is a third way: using a managed service that takes care of everything, offered by the very company that created Terraform. It's called Terraform Cloud (recently renamed HCP Terraform). In this subchapter, you'll see what it offers and when it's appropriate.

What is Terraform Cloud / HCP Terraform

Terraform Cloud (now HCP Terraform, where HCP stands for "HashiCorp Cloud Platform") is HashiCorp's managed platform—the company that created Terraform—for running and managing Terraform. It's like having everything we've set up manually (remote state, locking, pipelines, plan review) but offered as a ready-to-use service, without you having to build or maintain anything.

Before (manually): you set up the S3+DynamoDB backend, the pipeline, the secrets...
With HCP Terraform: all of that is solved as a managed service

Analogy: if setting up your own backend and pipeline is like cooking at home (total control, but you buy, cook, and clean), HCP Terraform is like going to a restaurant: you get the complete and ready service, for a price. You don't maintain the kitchen, you just enjoy the result.

What it offers, all-in-one

HCP Terraform brings together in a single platform many of the things that in previous chapters we configured piece by piece:

  1. Managed remote state

It stores and manages your state (Chapter 11) for you, with locking (subchapter 20.2), versioning, and encryption included. You don't need to set up the S3 + DynamoDB backend from subchapter 20.1: it's already solved.

  1. Remote execution of Terraform

It runs plan and apply on their servers, not on your laptop or in your pipeline. This provides consistency (always the same environment) and security (credentials live on the platform, not on scattered machines).

  1. Workflow with plan review

Integrated with Git, it runs the plan automatically on every change and displays it for review and approval (the flow from subchapter 12.5), just like Atlantis but as a managed service.

  1. Management of variables and secrets

It securely stores the variables and secrets (subchapter 19.4) that your configurations need, without you having to set up your own system.

  1. Private module registry

It offers a private registry for your organization's modules (remember the Registry from subchapter 18.3), with versioning, to share them among teams.

  1. Governance controls (in advanced plans)

It allows you to define policies (with Sentinel or OPA) that automatically check that the infrastructure complies with company rules before being applied—similar to the security analysis in subchapter 21.2, but as mandatory policies.

Comparison with the other options

Own pipeline (GitHub Actions) Atlantis HCP Terraform
Who maintains it You (you build it) You (you host it) HashiCorp (managed)
Setup effort Medium Medium-high Low
State and locking You set it up (S3+DynamoDB) You set it up Included
Cost Low (you pay for the cloud) Low (you pay for the server) Has free and paid plans
Control/privacy Total Total You depend on the service
Ideal for Flexibility, technical teams Self-hosted GitOps Speed, less maintenance

Note: HCP Terraform has a free tier for small teams and paid plans for organizations. It's worth checking the current prices according to your size.

When to choose HCP Terraform?

It makes sense when:

  • You want to start quickly without setting up backend, pipeline, or maintenance. It's the most "turnkey" option.
  • You don't want to maintain your own CI/CD infrastructure for Terraform (neither a complex pipeline nor a self-hosted Atlantis).
  • You value integrated governance and collaboration features (policies, module registry, team management).
  • Your team prefers to pay for a service in exchange for saving operational time.

When NOT to?

  • If you want total control over where everything runs and where your credentials live (some companies, by policy, prefer everything in their own cloud).
  • If your case is simple and a basic GitHub Actions pipeline (subchapter 22.1) is enough for you at no additional cost.
  • If you prefer not to depend on an external platform.

The decision: the three ways

In summary, to automate Terraform you have three paths, and none is the universal "right one":

1. Own pipeline (GitHub Actions...) → flexible, you build it
2. Atlantis (self-hosted)           → specialized GitOps, you maintain it
3. HCP Terraform (managed)          → turnkey, maintained by HashiCorp

Choose according to your team size, how much maintenance you want to take on, your control/privacy needs, and your budget. Many teams start with a simple pipeline and evolve as they grow.

What you should remember

  • Terraform Cloud / HCP Terraform is HashiCorp's managed platform for running and managing Terraform: it offers as a service everything you would set up manually. Like going to a restaurant instead of cooking at home.
  • It includes: managed remote state with locking, remote execution, workflow with plan review, management of variables and secrets, private module registry, and governance controls.
  • Compared to the other options: less maintenance (managed by HashiCorp) in exchange for depending on the service and its cost (has a free tier and paid plans).
  • Choose it if you want to start quickly and not maintain your own CI/CD infrastructure; avoid it if you need total control/privacy or your case is simple and a basic pipeline is enough.
  • The three ways to automate Terraform: own pipeline, Atlantis (self-hosted), or HCP Terraform (managed). Choose according to team, maintenance, control, and budget.

In the last subchapter of the chapter (and of Part V) we will see an important problem that automation helps solve: drift detection and automatic reconciliation.

Cloud, AWS & Terraform — From Zero to Expert

Chapter 1 · What is cloud computing

Chapter 2 · The cloud market and major providers

Chapter 3 · Regions, availability zones and edge

Chapter 4 · Compute: EC2

Chapter 5 · Storage: S3

Chapter 6 · Networking: VPC

Chapter 7 · Identity and access: IAM

Chapter 8 · Managed databases

Chapter 9 · Why Infrastructure as Code

Chapter 10 · HCL: the Terraform language

Chapter 11 · Providers and state

Chapter 12 · Your first real infrastructure in Terraform

Chapter 13 · Load balancing and auto scaling

Chapter 14 · Serverless with Lambda

Chapter 15 · Messaging and events

Chapter 16 · Content delivery and DNS

Chapter 17 · Containers on AWS

Chapter 18 · Modules: reuse and composition

Chapter 19 · Workspaces and environment management

Chapter 20 · Remote backends and locking

Chapter 21 · Infrastructure testing

Chapter 22 · Terraform in CI/CD

Chapter 23 · Defense in depth

Chapter 24 · Observability: logs, metrics and traces

Chapter 25 · Cost optimization

Chapter 26 · High availability and disaster recovery

Chapter 27 · AWS Well-Architected Framework

Chapter 28 · Serverless architectures at scale

Chapter 29 · Data platforms on AWS

Chapter 30 · Multi-account and landing zones

Chapter 31 · Platform Engineering and Internal Developer Platform

Chapter 32 · Relevant AWS certifications

Chapter 33 · Projects to consolidate what you've learned

Chapter 34 · Resources and community

© Copyright 2024. All rights reserved