Module 07 of 13

Infrastructure as Code

Lessons

About This Module

Clicking through a cloud console to spin up servers works fine once — it falls apart the moment you need to do it again reliably, in a different region, or after a teammate accidentally changes a setting by hand. This module covers Infrastructure as Code with Terraform: describing infrastructure declaratively with providers and resources, and how Terraform's state tracks what it has already created.

It also covers organizing configurations into reusable modules, storing state safely in remote backends, separating environments with workspaces, and a first look at configuration management with Ansible for configuring the servers Terraform provisions.

Watch the lessons in order, then continue on to Cloud Providers.

Lessons

8 videos · 1 article
01

Infrastructure as Code: Why Declare Your Infrastructure?

The problems with manually clicking through a console — drift, inconsistency, no history — and how treating infrastructure as code fixes them.

02

Terraform Basics: Providers, Resources & State

The core Terraform workflow — write, plan, apply — and how providers and resources map to real infrastructure, tracked in a state file.

03

Writing Terraform Configurations

HCL syntax, variables, outputs, and structuring a project's .tf files so they stay readable as infrastructure grows.

04

Terraform Modules & Reusability

Packaging common infrastructure patterns into modules so teams stop copy-pasting the same resource blocks across projects.

05

Managing State & Remote Backends

Why local state files are risky for teams, and storing state remotely with locking to prevent conflicting changes.

06

Terraform Workspaces & Environments

Managing dev, staging, and production from the same configuration using workspaces and variable-driven environment separation.

07

Configuration Management: Ansible Basics

Using Ansible playbooks to configure servers after they're provisioned — installing packages, managing files, and enforcing consistent state.

08

IaC Best Practices & Drift Detection

Keeping configurations reviewable through pull requests, detecting when real infrastructure drifts from what's declared, and reconciling it safely.

09

Terraform Reference Guide

A written reference covering Terraform syntax, core commands, and module structure from this module — good for a quick lookup after watching the videos.

Article