IaC Fundamentals
Provision and change infrastructure through reviewed, declarative code with Terraform or OpenTofu, managing state, modules and drift safely.
5 objectives 6 steps about 160 min
Learn it step by step
Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Explain declarative provisioning, the plan and apply cycle and the role of state, and contrast it with configuration management tools such as Ansible.
- Write a configuration with providers, resources, variables, outputs and a reusable module, with provider versions pinned in a lock file.
- Keep state in a locked remote backend, separate environments, and review a plan to catch destructive or unintended changes before applying.
- Detect and reconcile drift, and bring an existing resource under management with import.
- Configure servers idempotently with an Ansible playbook (inventory, modules, handlers and templates), preview it with check and diff mode, and decide when to bake an image instead.
Lesson plan
6 steps, about 160 min · 5 of 5 lessons available so far
- Why infrastructure belongs in code: provisioning, configuration and images Concept · 20 min
- Lab: plan, apply and destroy, then extract a reusable module Lab · 40 min
- Remote state, environments and the checks every plan should pass Concept · 25 min
- Reading a plan like a reviewer: drift, import and state refactoring Worked example · 25 min
- Lab: configure a small fleet idempotently with an Ansible playbook Lab · 30 min
- Check: plan review, drift and configuration scenarios Knowledge check · 10 questions
Practise it
With Terraform or OpenTofu, write a module that provisions a small environment (for example a container network, a container and a storage bucket using the Docker provider and an S3-compatible backend, or the equivalent on a cloud free tier), instantiate it for dev and staging with different variables, keep state in a locked remote backend, run plan on every pull request together with fmt, validate, tflint and a misconfiguration scan, then change a resource by hand and use plan to detect and reconcile the drift; finally write an Ansible playbook that installs and configures a web server on two hosts from an inventory, shows its intended changes in check and diff mode, and reports zero changes on a second run.
References
Hard prerequisites
None.
Unlocks
Nothing depends on this skill yet.
On these roadmaps
Progress and evidence for this skill are shared across all of them.