Track · Engineering skills

Infrastructure as code

Describe cloud infrastructure in files, review the plan before anything changes, and judge what agents write with Terraform and OpenTofu.

In short

This track is for product managers, founders and developers. You will ask agents to change cloud resources. You do not need to write code. Infrastructure as code means you describe servers, networks and permissions in files in git. A tool reads the files and makes the change. You will read a plan before anything changes. You will find what will be added, changed or destroyed.

You will learn why the tool’s state must be protected. You will direct an agent to write the files in a merge request. You will also check for drift. You will set what agents may do, and ask about cost and security. Nothing real changes until a person has read the plan and approved it.

Key words

  • IaC (infrastructure as code): Cloud setup written as files in git.
  • Plan (infrastructure as code): A preview of what the tool will add, change or destroy. You read it before you approve.
  • State (infrastructure as code): The tool’s memory of what it has built. Protect it, and keep one shared copy.
  • Drift: Any difference between desired state and actual state.
  • Merge request (MR): A proposal to add a change to the main branch. Also called a pull request.

Infrastructure as code (IaC) means that the servers, networks, databases and permissions your product runs on are described in text files, kept in git, and created by a tool reading those files. Instead of clicking through a cloud console, you write what you want. The tool compares it with what exists, shows you the difference, and, once you approve, makes the change.

For someone directing AI agents this is the safest way to let them near infrastructure. An agent can write a file, and a person can read the file and the plan before anything real changes. The alternative, an agent clicking or typing live commands, leaves no record and no review.

This track gives you enough depth to direct and judge: to read a file, read a plan, notice that something will be destroyed, and ask whether the change is safe.

Who this is for

Product managers, founders and developers who will ask agents to create or change cloud resources. You should know the basic cloud parts from Cloud platforms and how a merge request works from Git and GitLab. You do not need to write code.

What you will be able to do

  • Explain declarative description: you state the end result, the tool works out the steps.
  • Read a short Terraform or OpenTofu file: providers, resources, variables, outputs.
  • Read a plan and pick out the lines that matter: what is added, changed, and above all destroyed or replaced.
  • Explain state: the tool’s memory of what it has built, why it must be protected, and why it must be shared.
  • Explain modules as reusable packages, and environments as separate copies.
  • Run the loop in a pipeline: plan in the merge request, apply after approval, detect drift.
  • Ask security and cost questions about infrastructure code, and set what agents may do.

The four lessons

# Lesson What you learn
1 Describing infrastructure Declarative files, resources, and the plan and apply cycle
2 State, modules and environments The tool’s memory, reuse, and separate copies
3 Infrastructure code in the pipeline Plan in the merge request, apply after approval, drift
4 Judging and securing infrastructure code Reading a risky plan, secrets, scanning, blast radius

How it maps to the program

The Master Developer program says everything is code, production changes only through reviewed merge requests, and drift is a defect. See Everything as code, GitOps and drift. This track is how that rule is applied to cloud resources; the Kubernetes and GitOps track applies it to what runs on a cluster.

Terraform and OpenTofu

Terraform is the best-known tool, made by HashiCorp. OpenTofu is an open source, community-governed fork that uses the same language and ideas. The Way prefers open source first, so the examples work with either, and the lessons say “the tool”. Check the current licence terms of any tool before you build a business on it; see Open source licences. Pulumi, the cloud providers’ own template languages and others exist, and the ideas carry over.

The running example

TrailMug, the fictional reusable-cup product, needs a bucket for its site, a small database and a few permissions. Maya directs agents to write the code, and reads every plan. People and numbers are invented.

Time needed

About 75 to 90 minutes per lesson, so six hours for the track. Hands-on work needs a free or throwaway cloud account with a budget alert, or the tool’s local practice mode; never your production account. Each exercise ends with your spec, your agent brief and your review notes in git.

Pair it with

Cloud platforms before it, and CI/CD alongside it. Security fundamentals after it for the defensive view.

Lessons

Lessons in order

You mark a lesson done at the end of the lesson. This is saved only in this browser, on this device. It is not a grade and not a certificate.

  1. Describing infrastructureFoundation75 min

    Infrastructure as code from first principles: declarative files, resources, variables, and the plan and apply cycle, with enough reading skill to judge an agent's code.

  2. State, modules and environmentsCore90 min

    The tool's memory of what it built, how reuse works, and how to keep test and production separate and alike: the places where infrastructure code goes wrong quietly.

  3. Infrastructure code in the pipelineCore80 min

    Plan on every merge request, apply only after approval, in a pipeline with protected branches and narrow credentials: how infrastructure changes safely, with or without agents.

  4. Judging and securing infrastructure codeAdvanced90 min

    How to review infrastructure changes for destruction, exposure, permissions and cost, and how scanners and policies help, so you can approve or reject an agent's plan with confidence.

All tracks · Learning resources