Topic 9 of 12
Infrastructure as Code with Terraform and OpenTofu
Learn what Infrastructure as Code is and how Terraform/OpenTofu plan, apply and track changes, using free local providers and no cloud account.
After this topic you can: You can write a small Terraform/OpenTofu configuration, read a plan before applying it, explain what state and locking protect, and choose between the two tools with facts.
7 lessons · 72 min · 0 of 7 done
Best read after: Cloud fundamentals with AWS, Git and collaboration
Draft. This lesson is written and waiting for a person to run every command and review it. It is safe to learn from, but check the official documentation for anything you depend on.
Lessons, in order
- 1What Infrastructure as Code meansCoreUnderstand why teams describe servers, networks and databases in files instead of clicking in a console, and what declarative means.7 min
- 2The workflow: init, plan, apply, destroyCoreRun the four core Terraform/OpenTofu commands on local files and learn to read a plan, including the +, ~, - and replace symbols.12 min
- 3Resources, variables and outputsCoreLearn how to parameterise a configuration with variables, read results with outputs, and how references create dependencies in HCL.10 min
- 4State, drift and lockingCoreSee what the Terraform/OpenTofu state file records, why it must stay out of Git, and how locks and drift checks protect shared infrastructure.13 min
- 5Modules: reusing configuration safelyCorePackage related resources into a module with inputs and outputs, call it more than once, and learn why pinning module versions matters.11 min
- 6Dev, staging and prod: environments and workspacesAdvancedCompare CLI workspaces with separate folders and backends for environments, and learn why isolation of state and credentials matters.10 min
- 7Terraform vs OpenTofu: what is the same and what differsCoreCompare Terraform and OpenTofu on licence history, governance, compatibility and registries so you can choose with facts, and run one config on both.9 min