Infrastructure as Code Fundamentals
Infrastructure as code is the practice of managing servers, networks, and cloud resources through machine-readable definition files rather than manual configuration. It makes infrastructure repeatable, version-controlled, and auditable.
itInfrastructure and operations | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Infrastructure as Code Fundamentals
Infrastructure as code is the decision to describe servers, networks, databases, and cloud services in files instead of keeping their setup in somebody's memory or browser history. The old method was clicking through a console, running a command, and hoping the next environment received the same spell. It usually did not. IaC gives the setup a durable form that Git can show, review, and recover.
The central trick is declarative work. You describe the destination, such as three servers with stated properties, and the tool works out which creates, updates, replacements, or deletions move reality toward it. That is pleasantly different from a shell script that must narrate every step. It is also why the same definition can be applied again without redecorating the infrastructure each time.
Then comes state, the unglamorous notebook that maps a definition to the real resource IDs behind it. Terraform keeps that notebook as a file or in remote storage; CloudFormation keeps the corresponding record in AWS. Lose the mapping and the tool no longer knows which real thing a tidy resource block is meant to describe. State is not decoration. It needs shared storage, locking, encryption, and restrained access, because no one enjoys two applies attempting to edit the same reality.
The working rhythm is write, plan, review, apply, and commit. A plan is the pause before the machinery moves: it shows the proposed creates, changes, and destroys so the change receives the same scrutiny as application code. Drift is the awkward case where reality changed outside that rhythm. A console edit can look harmless until the next plan notices it and offers to put the world back the way the file says it should be.
Read the Intro when the vocabulary needs a proper map, and use the Slides for the relationships between tools, state, modules, testing, and delivery. The Cheatsheet is for the names and command-shaped details. Field Notes covers where coordination and recovery become the real work. The Reference tab then leads into Terraform, CloudFormation, Pulumi, and Ansible documentation, because tools differ, but the habit of making infrastructure reviewable and repeatable is the part worth carrying forward.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://developer.hashicorp.com/terraform/intro
Supports
- Terraform workflow (init, plan, apply)
- Declarative infrastructure definition with HCL
- State file purpose and management
- Provider and module system
- Resource lifecycle (create, update, destroy, replace)
- State locking and remote backends
- Import of existing resources
- Lifecycle rules (prevent_destroy, ignore_changes)
- https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html
Supports
- AWS-native template-based infrastructure management
- Stack lifecycle and change sets
- AWS-managed state (no external state file)
- https://www.pulumi.com/docs/concepts/
Supports
- General-purpose language approach to IaC
- State management with Pulumi backends
- Programming language benefits (loops, types, testing)
- https://docs.ansible.com/ansible/latest/getting_started/index.html
Supports
- Agentless configuration management via SSH
- YAML playbook structure
- Idempotent task execution
- https://learn.microsoft.com/en-us/devops/deliver/what-is-infrastructure-as-code
Supports
- Vendor-neutral IaC principles and benefits
- Declarative vs imperative distinction
- IaC within DevOps practices
- Reproducibility and consistency benefits
- https://docs.cfengine.com/docs/archive.bak/cf2-enterprise.html
Supports
- CFEngine began in 1993
- Early automated configuration management for networked computers
- https://www.puppet.com/about
Supports
- Puppet was founded in 2005
- Puppet addressed manual configuration management
- https://cfengine.com/blog/2009/a-big-thank-you-to-our-users/
Supports
- CFEngine 3 Community Edition announcement
- https://aws.amazon.com/about-aws/whats-new/2011/02/25/introducing-aws-cloudformation/
Supports
- AWS CloudFormation launch in February 2011
- Template-driven provisioning in dependency order
- CloudFormation has no additional charge
- https://github.com/hashicorp/terraform/releases/tag/v0.1.0
Supports
- Terraform 0.1.0 release tag
- https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/doc-history.html
Supports
- CloudFormation resource specification publication in November 2016
- https://www.pulumi.com/blog/introducing-pulumi-a-cloud-development-platform/
Supports
- Pulumi launch in June 2018
- Open-source IaC using general-purpose languages
- https://techcommunity.microsoft.com/blog/azuretoolsblog/introducing-project-bicep/2057347
Supports
- Project Bicep introduction in December 2020
- Bicep as an authoring layer for Azure Resource Manager templates
- https://www.linuxfoundation.org/press/announcing-opentofu
Supports
- Linux Foundation launch of OpenTofu in September 2023
- OpenTofu as an open-source alternative to Terraform
- https://www.hashicorp.com/license-faq
Supports
- Terraform's Business Source License posture
- https://opentofu.org/docs/intro/
Supports
- OpenTofu's HCL and state-based infrastructure workflow
