Course → 2 · CI/CD & platforms → Infrastructure as Code
2 · CI/CD & platforms
Theory · Infrastructure as Code
18 min · Module 9 · Theory
How to study this topic
- Read the theory below (concepts, bullets, and shell/YAML examples).
- Try the Exam pool and Book quizzes in this module.
- After each quiz, use Show answer on every question to review.
Infrastructure as Code
Terraform, Ansible, and Pulumi define infrastructure in version-controlled files. Plan before apply; remote state with locking prevents concurrent corruption.
- Declarative (Terraform): describe desired state; provider reconciles.
- Idempotent (Ansible): playbooks safe to re-run.
- Modules: reuse VPC, EKS patterns across environments.
Shell, YAML & config examples
terraform init
terraform plan -out=tfplan
terraform apply tfplan
# Ansible
ansible-playbook -i inventory prod.yml
Hands-on practice: /lab/