Lion Cipher Lab
Manage Infrastructure-as-Code with Terraform (no cloud needed)
- Cloud Security
- Beginner
- ~40 min
- Free · no account required
Why it matters
Infrastructure-as-Code (IaC) means you describe your infrastructure -- servers, networks, storage, firewall rules -- as text files and let a tool build it, instead of clicking around a console. That is how modern cloud is actually run: the setup is versioned in Git, reviewed like any other code, and reproducible on demand. Terraform is the most widely used IaC tool, and OpenTofu is its open-source fork, so learning the workflow here transfers almost everywhere. Two things make this a security topic, not just an ops one. First, the Terraform state file (terraform.tfstate) is a JSON record of…
What you'll learn
- what Infrastructure-as-Code (IaC) is: declaring infrastructure in code, versioning it, reviewing it
- installing Terraform or OpenTofu and understanding how they relate
- writing a tiny main.tf with the local and random providers (no cloud account, no spend)
- running the core loop: init, plan, apply, destroy
- understanding Terraform state and why terraform.tfstate is sensitive (gitignore it; use encrypted remote state in real life)
- secure IaC habits: never hardcode secrets, review the plan before apply, scan with tfsec or Checkov, expect drift
Steps in this lab
- What Infrastructure-as-Code actually means
- Install Terraform (or OpenTofu) -- no cloud account required
- Write a tiny main.tf using the local and random providers
- Initialize the working directory (terraform init)
- Preview the change (terraform plan), then read it
- Make it real (terraform apply)
- Understand STATE -- and why it is sensitive
- Clean up (terraform destroy) and scan before you deploy
- Why this loop is worth making a reflex