Skip to content

Terraform & Terragrunt for GCP — From Zero to Hero

Terraform is a declarative infrastructure-as-code tool: you describe the cloud resources you want in HCL, and Terraform figures out how to make reality match — creating, updating, or destroying resources as needed. This course is written for developers — people who write and review Terraform changes, manage state across a team, and have to make infrastructure changes safely in production.

Every example in this course targets Google Cloud (GCP), using real resource types (google_compute_instance, google_storage_bucket, google_service_account, and so on) and a real GCS remote backend — the HCL syntax, state model, and Terragrunt concepts you learn transfer directly to any other provider; only the resource type names and backend configuration change. Where current practice is easy to get wrong from stale tutorials — like Terragrunt’s run --all command replacing the deprecated run-all/plan-all — this course teaches the current, correct form and says so explicitly.

ModuleYou will learn
FoundationsInfrastructure as Code, HCL syntax, providers and resources, the dependency graph, the Terraform workflow
State ManagementThe state file, remote backends and locking, drift detection and import, sensitive data in state
Variables & Data FlowInput variables, outputs and locals, expressions and functions, count vs for_each
ModulesWriting reusable modules, composition and sources, versioning, testing with terraform test
Multi-EnvironmentThe dev/staging/prod problem, Terraform workspaces, directory-per-environment, why Terragrunt exists
Terragrunt Fundamentalsroot.hcl, DRY configuration with include, dependency blocks between units, running many units at once
Production & EcosystemCI/CD for infrastructure, policy as code and static analysis, secrets and credentials, a production checklist

Each lesson opens with the idea in one sentence, shows real HCL and CLI commands, has a diagram of the moving parts, and ends with a one-line takeaway plus a short quiz. Work top to bottom — later modules assume the resource, state, and dependency-graph vocabulary from these first lessons.