Chapter 1: Foundations
Topic 02

What Terraform Is

ConceptTooling

Terraform is HashiCorp's tool for provisioning infrastructure across any cloud or API through one declarative language and a plugin system of providers. You declare what you want, run terraform apply, and Terraform calls the underlying APIs — on Google Cloud, the GCP REST APIs — to make reality match, recording everything it created in a state file so it knows what to change next time.

It is worth being precise about what Terraform is and is not, because the word gets stretched. Terraform is the engine and the language. It is not the Google provider, not the managed services that run it for you, and not tied to any one cloud. Those distinctions are the whole of this topic, and getting them straight now saves confusion in every chapter that follows.

The Terraform Model: Three Parts

The entire system is three parts. Configuration is the HCL you write — the resources, variables, and outputs that describe desired state. Providers are plugins that translate that configuration into real API calls; the google provider knows how to turn a google_storage_bucket block into a Cloud Storage API request. State is the record of what Terraform created, the map between your configuration and the real resources it stands behind.

Everything in this course is one of those three things or the workflow that connects them. When a plan surprises you, the answer is almost always in how configuration, providers, and state relate. Hold the three-part model and the rest has a place to hang.

The three parts, in miniature
terraform {
  required_providers {
    google = {
      source  = "hashicorp/google"   # the provider plugin
      version = "~> 7.0"
    }
  }
}

provider "google" {
  project = "hatch-pipeline-dev"      # configuration the provider reads
  region  = "us-central1"
}

resource "google_storage_bucket" "raw" {   # tracked in state once applied
  name     = "hatch-events-raw"
  location = "US"
}

That snippet names all three: the required_providers block declares the provider, the provider block configures it, and the resource becomes a tracked entry in state after the first apply. The next chapters take each part apart in turn.

The three parts of Terraform
Configuration
The HCL you write — resources, variables, outputs that describe desired state.
Providers
Plugins that translate config into API calls; the google provider speaks to GCP.
State
The record of what was created — the map between config and real resources.

Provider-Agnostic by Design

Terraform's engine knows nothing about Google Cloud. It knows how to read HCL, build a graph of resources, and walk that graph calling whatever provider each resource names. The google provider is one of hundreds — AWS, Azure, Kubernetes, GitHub, Cloudflare, Datadog — and they all plug into the same engine and the same workflow.

The practical consequence is that the language, the state model, and the plan/apply loop you learn here carry to every other provider unchanged. What changes between clouds is the provider — the resource names and their arguments. That is why this course separates the universal Terraform skill from the GCP-specific surface, and spends real time on the parts that are genuinely particular to Google Cloud.

The HashiCorp Ecosystem and Infrastructure Manager

Around the open tool sit a few related things people conflate with it. The Registry at registry.terraform.io hosts providers and shared modules. HCP Terraform is HashiCorp's managed SaaS that runs Terraform for you, stores state, and adds policy and run pipelines. And on Google Cloud specifically, Infrastructure Manager is Google's own managed service that runs the exact same Terraform on your behalf, hosting the state and tying into GCP IAM.

None of these is a different tool or language. They run the same HCL the local CLI runs. Whether you execute Terraform from your laptop, from a CI pipeline, from HCP Terraform, or from Infrastructure Manager is an operational choice covered later — the configuration is identical across all of them.

The License Change and OpenTofu

In 2023 HashiCorp relicensed Terraform from the open MPL 2.0 to the Business Source License, which restricts using Terraform's source to build a competing product but leaves normal use untouched. The community forked the last MPL version as OpenTofu, now stewarded by the Linux Foundation. OpenTofu runs the same google provider and is roughly ninety-nine percent compatible; the two diverge only on newer features — OpenTofu shipped client-side state encryption early, Terraform shipped Stacks — and on the license itself.

This course teaches HashiCorp Terraform 1.x and calls out OpenTofu only where behavior genuinely differs. Choose between them at the organization level based on license policy, then standardize so everyone runs the same binary. Everything you learn about the language, state, and workflow applies to both.

Terraform vs OpenTofu

Terraform — HashiCorp, under the Business Source License. The HCL language, the google provider, and the CLI are what this course teaches. Ships some features first (Stacks, ephemeral resources). Choose it as the default unless an open-source license is a hard requirement.

OpenTofu — the Linux Foundation fork, under MPL 2.0. Nearly drop-in compatible; configs are portable today and migrating is usually changing the binary, not the code. Choose it when an open-source license is mandated, and decide once at the org level.

Common Mistakes
  • Assuming Terraform is AWS-first because most tutorials use AWS — the google provider is a first-class, heavily used provider and the engine itself is cloud-neutral.
  • Believing OpenTofu and Terraform configs are incompatible and that switching means a rewrite — for almost all GCP configs the migration is the binary, not the code.
  • Conflating the Terraform CLI you run with HCP Terraform or Infrastructure Manager and assuming you must pay to use Terraform at all.
  • Pinning to a years-old version to dodge the license question without knowing the BSL only restricts building a competing product, not normal use.
  • Treating the google provider and the Terraform engine as one thing, then being confused when a provider upgrade changes resource behavior while the CLI is unchanged.
Best Practices
  • Hold the three-part model — configuration, providers, state — as the frame for everything; most confusion resolves to how those three relate.
  • Treat the google provider as the cloud-specific part and the Terraform language as transferable knowledge that carries to every other provider.
  • Decide Terraform versus OpenTofu once at the organization level on license policy, then standardize so the whole team runs the same binary.
  • Pin the Terraform version per project with required_version so the team and CI run identical behavior.
  • Read the provider documentation on the Registry as the source of truth, since the same resource differs across provider major versions.
Comparable tools OpenTofu the open-source fork, same language and providers Pulumi provisioning in TypeScript, Python, or Go instead of HCL Config Connector provisions GCP through the Kubernetes API Deployment Manager GCP's deprecated native equivalent

Knowledge Check

What are the three parts of the Terraform model?

  • Configuration (HCL), providers (plugins that call APIs), and state (the record of what exists)
  • The command-line interface, the GCP Cloud Console, and the project's own attached billing account
  • The three workflow commands plan, apply, and destroy that you run in order
  • The GCP location hierarchy of projects, regions, and zones

Why is Terraform described as provider-agnostic?

  • The engine knows nothing about any one cloud; the provider plugin supplies all the cloud-specific behavior
  • It works only with the specific clouds that HashiCorp has formally partnered with up front directly
  • It transparently translates one cloud's resource types into another cloud's equivalents automatically for you
  • It requires you to install a separate Terraform binary for each cloud provider

What did the 2023 license change to the Business Source License actually restrict?

  • Using Terraform's source to build a competing product, while leaving ordinary use unaffected
  • Running Terraform in any commercial work setting at all without first buying a paid seat license
  • Using the AWS and Google providers together inside one single shared configuration
  • Managing more than a fixed licensed number of resources per single state file

How does Infrastructure Manager relate to the Terraform you run locally?

  • It is a Google-managed service that runs the same Terraform HCL for you and hosts the state
  • It is an entirely different configuration language that you have to go and learn separately first
  • It fully replaces Terraform with a separate GCP-only provisioning engine
  • It is just the local Terraform CLI's built-in offline mode

You got correct