Chapter One

Foundations

What Infrastructure as Code buys you, the idea Terraform rests on, where it sits among GCP's own IaC tools, and the daily loop of init, plan, and apply — built up to your first real resource in a real Google Cloud project.

7 topics

Terraform is a small idea surrounded by a large vocabulary. The idea is that you describe the infrastructure you want in text, and a tool makes reality match — creating what is missing, changing what drifted, and remembering what it built. Everything else is detail in service of that.

This chapter lays the groundwork. What Infrastructure as Code actually solves and why declarative beats scripting, what Terraform is and how it compares to Google Cloud's own IaC options, how to install it alongside the gcloud SDK, what a provider is, your first real resource in a Google Cloud project, and the shape of the HCL language. The rest of the course assumes these seven pages.

Topics in This Chapter

Topic 01
What Infrastructure as Code Is
Defining infrastructure in version-controlled text instead of clicking a console or running gcloud by hand. Why declarative beats imperative, what idempotency means, and the layers IaC splits into.
ConceptIaC
Topic 02
What Terraform Is
The configuration / providers / state model, why Terraform is provider-agnostic, the BSL license change, and where OpenTofu fits.
ConceptTooling
Topic 03
Terraform vs GCP's Native IaC
Which of GCP's four IaC options are alive and which are dead: Deployment Manager, Config Connector, Infrastructure Manager, and gcloud — and why Terraform is the default.
Comparison
Topic 04
Installing Terraform and the CLI
Getting the binary and the gcloud SDK, managing versions across a team, the first authentication that lets Terraform talk to GCP, and the editor setup worth doing once.
ToolingCLI
Topic 05
Providers and the Registry
The plugins that teach Terraform to talk to an API, how you declare the google provider, google versus google-beta, and the Registry as the authoritative reference for every argument.
Providers
Topic 06
Your First Configuration
The end-to-end loop on a real project: write a config, init to download the provider, plan to preview, apply to create a Cloud Storage bucket, destroy to tear down — and what each step reads and writes.
Workflow
Topic 07
HCL Syntax Basics
Blocks, arguments, types, and references. How Terraform merges files in a directory, why a reference is how dependencies are expressed, and what terraform fmt standardizes.
Language