Language

IaC Fundamentals · Lesson 2 of 30

What is IaC?

Source: doonops-curriculum/iac-fundamentals--what-is-iac.md

Doonops lesson

Goal

Understand Infrastructure as Code and why teams use Terraform.

Simple explanation

Instead of clicking AWS console for every server, you write a recipe file. Terraform reads it and creates/updates cloud resources to match.

Technical view

IaC treats infrastructure as versioned configuration. Terraform is declarative: you describe desired state; the tool plans and applies changes with a dependency graph.

Think of it like

Like an architect blueprint — you draw once, builders (Terraform + AWS) make reality match the drawing.

Steps

  1. Read simple + technical sections
  2. Follow local lab on your laptop
  3. Run terraform validate

Deep explanation

Layman words first, then technical detail — read slowly

Infrastructure as Code (IaC) means networks, servers, and load balancers are defined in files stored in Git — reviewed like application code.

Terraform (by HashiCorp, now IBM) uses HCL language and supports AWS via the hashicorp/aws provider. Current practice: Terraform CLI 1.9+, AWS provider 5.x, remote state in S3 with DynamoDB locking.

Example (Doonops)

Modern HCL — names are examples, not from any third-party course

Example HCL
HCL
# doonops-sample.tf — first look at HCL
terraform {
  required_version = ">= 1.9.0"
}

# We will add provider and resources in later lessons

Terraform runs on your computer — copy this HCL into a folder, then follow the local lab steps below.

Project files for this lab

Full implementation folder — copy all files, then run terraform commands

Lab project files (full folder)

Copy every file below into one folder — same as a real repo module. Then run the local lab steps.

Suggested folder: Suggested path: ~/doonops-terraform/01-iac-basics/

versions.tfSee file purpose in the code below
terraform {
  required_version = ">= 1.9.0"
}

On your computer (this module)

Prerequisites

  • Terminal (Mac/Linux) or PowerShell (Windows)
  • No AWS account needed yet
  1. Create folder: mkdir -p ~/doonops-terraform/lab01 && cd ~/doonops-terraform/lab01
  2. Create file main.tf with the HCL example above (use any text editor).
  3. Install Terraform: brew install terraform (Mac) or download from developer.hashicorp.com/terraform/downloads
  4. Run: terraform version — you should see 1.9.x or newer
  5. Run: terraform init — creates .terraform folder (no cloud yet)
  6. Run: terraform validate — should say Success

Quick check

  • terraform version shows >= 1.9
  • terraform validate passes in lab01 folder