Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStatsPractice TestsCertifications

Categories

🎓 Certifications
🤖 Artificial Intelligence
☁️ Cloud and Infrastructure
💾 Data and Databases
💼 Professional Skills
🎯 Programming and Development
🔒 Security and Networking
📚 Specialized Topics
CheatGrid
HomeAboutTopicsPricingMy VaultStatsPractice TestsCertifications
LVLEVEL 0
0/5 XP
GitHub
© 2026 CheatGrid™. All rights reserved.
Privacy PolicyTerms of UseAboutContact

Infrastructure as Code Cheat Sheet

Infrastructure as Code Cheat Sheet

Back to DevOps
Updated 2026-05-25
Next Topic: Jenkins Cheat Sheet

Infrastructure as Code (IaC) is the practice of managing and provisioning infrastructure through machine-readable definition files rather than physical hardware configuration or interactive configuration tools. IaC enables teams to version, test, and deploy infrastructure with the same rigor applied to application code, transforming infrastructure management from a manual, error-prone process into an automated, repeatable one. A key distinction in IaC is between declarative approaches (defining desired end state) and imperative approaches (defining step-by-step procedures)—understanding when to use each fundamentally shapes how infrastructure is designed, validated, and evolved over time.

What This Cheat Sheet Covers

This topic spans 13 focused tables and 124 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.

Table 1: Core IaC ConceptsTable 2: Leading IaC ToolsTable 3: IaC Syntax and Language FeaturesTable 4: State Management and BackendsTable 5: Deployment Patterns and StrategiesTable 6: Testing and ValidationTable 7: Security and ComplianceTable 8: CI/CD IntegrationTable 9: Dependency ManagementTable 10: Advanced PatternsTable 11: Configuration Management ToolsTable 12: Monitoring and ObservabilityTable 13: Best Practices

Table 1: Core IaC Concepts

Foundational IaC vocabulary — understanding the difference between declarative vs. imperative, mutable vs. immutable, and why state matters — shapes every architectural decision downstream.

ConceptExampleDescription
Declarative
resource "aws_instance" "web" {
ami = "ami-12345"
instance_type = "t2.micro"
}
• Specify desired end state
• the IaC tool determines how to achieve it, handling resource creation, updates, and dependencies automatically
Imperative
- name: Install nginx
apt:
name: nginx
state: present
• Define step-by-step instructions
• the tool executes commands in sequence, giving precise control but requiring explicit dependency management
Idempotency
terraform apply (run 10 times → same result)
• Running the same configuration multiple times produces the same result
• prevents duplicate resources and ensures consistent infrastructure state
Immutable Infrastructure
ami_id = data.aws_ami.latest.id
• Servers are never modified after deployment
• updates create entirely new instances, eliminating configuration drift and enabling reproducibility
State Management
terraform {
backend "s3" {
bucket = "tfstate"
}
}
• Tracks the current state of infrastructure
• essential for detecting drift, planning changes, and enabling team collaboration
Drift Detection
terraform plan -refresh-only
• Identifies discrepancies between actual infrastructure and code-defined state
• crucial for maintaining compliance and catching manual changes

More in DevOps

  • Incident Management Cheat Sheet
  • Jenkins Cheat Sheet
  • AI-Powered DevOps Copilots and Agents Cheat Sheet
  • Configuration Drift Cheat Sheet
  • GitOps Cheat Sheet
  • Pulumi Programmatic IaC Cheat Sheet
View all 49 topics in DevOps