Terraform
Describe Azure infrastructure as Terraform code: plans, state, modules, environments and secrets, then build Waypoint's whole Azure environment and prove you can destroy and rebuild it.
Modules
11
Lessons
82
Level
Intermediate
Project
Reviewed by a mentor
About This Course
In Azure Fundamentals you built infrastructure by clicking and typing commands. In this course you describe it in code, so it can be reviewed, versioned, repeated and destroyed safely. You start with why infrastructure as code exists, then learn the Terraform language, state, the resource lifecycle, modules, environments, secrets and code quality. You finish by writing Waypoint's entire Azure environment for Trecho in Terraform, and proving you can destroy it and bring it back identically.
You'll Be Able To
- Explain infrastructure as code and how Terraform works.
- Write Terraform for Azure using variables, outputs, locals, loops and conditionals.
- Read a plan and spot destructive changes before applying them.
- Manage state safely with a remote backend and locking.
- Write and use modules, and organise code for multiple environments.
- Keep secrets out of code, and protect the state that holds them.
- Deploy an application's full infrastructure from code and recreate it on demand.
What's Inside
- 1
Infrastructure as code
7 lessons
Learn why teams describe infrastructure in code instead of clicking, how Terraform compares with other tools and works inside, then install it and read your first configuration.
- 2
Your first deployment
9 lessons
Connect Terraform to your Azure subscription, pin provider versions, and take a resource group and a storage account through init, plan, apply and destroy, reading every plan.
- 3
The Terraform language
12 lessons
Learn the Terraform language properly: resources and references, dependencies, data sources, types, and variables, outputs and locals that make one configuration reusable.
- 4
Expressions and functions
9 lessons
Make one configuration adapt to its data with templates, functions, conditionals, count, for_each, for expressions and dynamic blocks, testing each in terraform console.
- 5
State
9 lessons
Look after Terraform's state: inspect it, catch drift, move it into Azure Storage with locking, protect its secrets, and rename or import resources without destroying anything.
- 6
The resource lifecycle
5 lessons
Read a Terraform plan for destructive changes, protect important resources with lifecycle rules, rebuild one resource on purpose with -replace, and know why targeted plans are a last resort.
- 7
Modules
8 lessons
Package Terraform code into reusable modules: call child modules, use and pin Registry modules, write your own with clear inputs and outputs, and lay out a project around them.
- 8
Environments
4 lessons
Keep dev and production apart: why each environment needs its own state, how workspaces and a directory per environment provide it, and how to choose between them.
- 9
Secrets and security
5 lessons
Keep secrets out of code and variable files: generate passwords, store them in Key Vault, give apps managed identities instead of passwords, and scan Terraform for security issues.
- 10
Code quality
5 lessons
Check Terraform before anyone reads it: format and validate, lint with TFLint, generate module docs with terraform-docs, enforce it all with pre-commit hooks, and review a teammate's plan.
- 11
Building Waypoint's infrastructure
9 lessons
Build Waypoint's whole Azure environment in Terraform: a private network and database, registry, Key Vault and identities, Container Apps and a budget, then destroy and rebuild it.