FoundationLesson 1 of 2 in IaC BasicsFree preview

Why IaC

Infrastructure as Code (IaC) means describing servers, networks, databases and permissions in text files, and letting a tool create them. The files live in Git, like application code.

Without IaC ("ClickOps"), people click around the cloud console:

  • Nobody knows exactly how production was built, so staging never quite matches it.
  • Changes are not reviewed, and there is no history of who changed what.
  • Rebuilding after a disaster means remembering hundreds of clicks.
  • Every hand-built server is a slightly different snowflake.

With IaC:

BenefitWhat it means
RepeatableCreate dev, staging and prod from the same code
ReviewableChanges go through pull requests
TraceableGit history shows who changed what, and why
RecoverableRebuild an environment by running the code again
AutomatableRun it from a CI/CD pipeline

Common tools

ToolNotes
Terraform / OpenTofuWorks with many clouds and services (via providers)
AWS CloudFormationAWS-native, YAML/JSON templates
Azure Bicep / ARM templatesAzure-native
PulumiIaC in general-purpose languages (TypeScript, Python, Go)

Provisioning vs configuration. Terraform creates infrastructure (VPC, VM, database). A configuration tool like Ansible sets up what runs on a server (packages, files, services). Teams often use both.

The trap: IaC only helps if people stop making manual changes. A quick fix in the console makes the code wrong (this is called drift).

In interviews: "Why IaC?" Give three words: repeatable, reviewable, recoverable.

Practice

Solve 3 of 4 to complete this lesson.

0/4 solved

Solve 3 more to complete this lesson, or move on and come back later.

Skip to next: Declarative vs Imperative