infrastructure as code
Describing servers, networks and other infrastructure in text files that a tool reads to create and change the real thing.
In more detail
Instead of clicking through a cloud console, you write what should exist into files and commit them to version control. The files can then be reviewed, compared, copied to build an identical second environment, and reused. Tools such as Terraform, OpenTofu and Ansible read the files and make the changes needed to match.
Examples
resource "aws_vpc" "main" { cidr_block = "10.0.0.0/16" }In Terraform: Instead of clicking through a cloud console, you write what should exist into files and commit them to version control. The files can then be reviewed, compared, copied to build an identical second environment, and reused. A tool such as Terraform compares the files with what really exists and makes the changes needed to match.Related terms
- Terraform — An infrastructure-as-code tool from HashiCorp that creates and changes cloud resources such as servers, networks and databases from configuration files.
- desired state — A description of how a machine should look when the work is finished, rather than a list of steps to get there.
- repository — A project folder whose full history is tracked by version control; in Git, your files plus the hidden .git directory that stores every commit.
- infrastructure state — The record an infrastructure-as-code tool keeps of what it created, so it can plan the next change.
- configuration drift — The slow, unrecorded way machines end up with different versions and settings from each other.
- Checkov — An open-source scanner that checks infrastructure-as-code files, such as Terraform, against numbered security checks without deploying anything.
- policy as code — Writing organisational rules, such as required tags or allowed regions, as code that automatically checks every proposed change.
- declarative — A style where you describe the end result you want and let the tool work out the steps to get there.
- version control — A system, usually Git, that records every change to a set of files with who made it and why, so work can be reviewed and rolled back.
- cloud console — The website a cloud provider offers for creating and managing resources by clicking through screens.
Taught in
- Two Hundred Accounts And One Bad Deploy — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- CloudFormation In Depth: Replace Or Update? — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- StackSets: Eighty Failures Before Lunch — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- Accounts At Scale: Vending, Guardrails And SCPs — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- Systems Manager At Fleet Scale: Compliant And Unpatched — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- Pipeline Security: The Build Role That Could Do Anything — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- Long-Stem Clinic: When Two Answers Both Work — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- The Full Mock And Your Review Plan — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- Infrastructure As Code In The Pipeline — Microsoft Azure DevOps Engineer Expert (AZ-400) Exam Prep
- Managing And Deploying Resources — Microsoft Azure Fundamentals (AZ-900) Exam Prep
- Governance Decision Drill — Microsoft Azure Fundamentals (AZ-900) Exam Prep
- Principles Sprint: Six Setups, One Question — Certified GitOps Associate (CGOA) Exam Prep
- Two Clicks Nobody Wrote Down: Configuration And Infrastructure As Code — Certified GitOps Associate (CGOA) Exam Prep
- Related Practices Sprint: One Change, Five Practices — Certified GitOps Associate (CGOA) Exam Prep
- The Evening Before: Final Review — Certified GitOps Associate (CGOA) Exam Prep
- Security Groups and Firewalls — Cloud Infrastructure & Hyperscaler Architecture
- The Console versus the CLI — Cloud Infrastructure & Hyperscaler Architecture
- Infrastructure as Code (Handover to Terraform) — Cloud Infrastructure & Hyperscaler Architecture
- Six Systems And A Lease That Ends In March — CompTIA Cloud+ (CV0-004) Exam Prep
- Two Environments That Should Have Been Twins — CompTIA Cloud+ (CV0-004) Exam Prep
- Sixty Six Of Eighty Five: The Mock And Its Report — CompTIA Cloud+ (CV0-004) Exam Prep
- Shared Responsibility Model & Cloud Threat Landscapes — Cloud Security & DevSecOps Engineering
- Static IaC Scanning: Linting Terraform with Checkov — Cloud Security & DevSecOps Engineering
- Continuous IaC Drift Detection & State Protection — Cloud Security & DevSecOps Engineering
- Cloud Security Posture Management & Remediation — Cloud Security & DevSecOps Engineering
- Infrastructure As Code Context — DevOps & Site Reliability Engineering
- What Is Infrastructure As Code? — Infrastructure as Code with Terraform
- The Licence, OpenTofu And IBM — Infrastructure as Code with Terraform
- Why Modules: Composition Versus Monoliths — Infrastructure as Code with Terraform
- The Plan That Wanted To Destroy Production — HashiCorp Terraform Associate (004) Exam Prep
- One Hour, No Weights Published — HashiCorp Terraform Associate (004) Exam Prep
- Infrastructure As Code, And One Workflow For Every Platform — HashiCorp Terraform Associate (004) Exam Prep
- The Full Mock: Sixty Minutes, Eight Areas, One Plan For The Last Week — HashiCorp Terraform Associate (004) Exam Prep
References
- AWS Whitepaper: infrastructure as code
- What is infrastructure as code with Terraform?
- What is Terraform?
- Terraform use cases
- NIST glossary: infrastructure as code
Certification courses
- AWS DevOps Engineer Professional course and practice exam: DOP-C02
- AZ-400 course and practice exam: Microsoft Azure DevOps Engineer Expert
- AZ-900 course and practice exam: Microsoft Azure Fundamentals
- CGOA course and practice exam: Certified GitOps Associate
- CompTIA Cloud+ course and practice exam: CV0-004
- Terraform Associate course and practice exam: HashiCorp Terraform Associate (004)