Infrastructure as code
Describe your infrastructure in files and let a tool build it.
6 technologies on this page ↓How it works
Instead of clicking through a console, you declare resources (networks, databases, queues, permissions) in files kept in git. The tool compares that desired state with what exists, shows a plan of what it will create, change or destroy, and then calls the cloud APIs to apply it. Environments become reproducible, changes get code review, and the history lives in version control.
An architect’s blueprint. Hand the same drawings to any builder and you get the same house, and every change starts as a revision on paper.
Reach for it when
- Anything beyond a quick experiment
- Keeping dev, staging and production identical
- Reviewing infrastructure changes like code, with a plan preview
Think twice when
- Editing tool-managed resources by hand in the console; that creates drift
- Treating the state file casually; store it safely and lock it
A real example
A pull request adds a queue and lets a function read from it. CI runs terraform plan, the reviewer sees “2 to add, 1 to change”, and merging applies it to staging and then production.
Technologies
Specific products, and what each does differently.
AWS Cloud Development Kit (CDK)AWSDefine AWS infrastructure in TypeScript, Python, Java, C# or Go; the CDK turns it into CloudFormation templates and CloudFormation deploys them. AWS Cloud Development Kit (CDK) | Managed service on AWS | Amazon Web Services | Apache 2.0 | 2026-10-06 |
| Commercial product | HashiCorp, an IBM company | Business Source License 1.1 since 1.10.0 (source-available, not OSI open source); MPL 2.0 before the August 2023 change | 2026-10-05 | |
| HCP Waypoint | Commercial product | HashiCorp, an IBM company | Proprietary SaaS (part of HCP, included with HCP Terraform Standard and Premium); the archived community Waypoint was MPL 2.0 up to its last release, 0.11.4 | 2026-10-05 |
| Open source | Cloud Native Computing Foundation | MPL 2.0 | 2026-10-06 | |
| Open source | Anomaly Innovations | MIT | 2026-10-06 | |
| Commercial product | HashiCorp, an IBM company | Business Source License 1.1 since 1.6 (source-available, not OSI open source); MPL 2.0 before the August 2023 change | 2026-10-05 |
What each provider calls it
- AWS
- CloudFormation, AWS CDK
- Google Cloud
- Infrastructure Manager
- Azure
- Bicep, ARM templates
- Open source & others
- Terraform, OpenTofu, Pulumi; SST for full-stack apps on AWS and Cloudflare; Packer for machine images; HCP Waypoint as a self-service portal on Terraform
In code · hcl
resource "aws_sqs_queue" "receipts" {
name = "receipts"
visibility_timeout_seconds = 60
}
resource "aws_s3_bucket" "media" {
bucket = "example-media-prod"
}
# $ terraform plan -> Plan: 2 to add, 0 to change, 0 to destroy.Worth exploring
kubectl apply a Function manifest that points at code in S3. It explains why you might (one GitOps and RBAC model for pods and functions) but, being AWS’s own post, not the drawbacks.Often confused with
Where it came from1993–2023
In 1993 Mark Burgess, a theoretical physicist at the University of Oslo, wrote CFEngine to automate the upkeep of Unix machines. Fixes made by hand or with shell scripts grew cumbersome and haphazard, and every flavour of Unix needed its own. CFEngine took another approach: describe in one file how every host should be configured, and let the tool check and repair each machine as many times as needed, without human intervention.
That idea of declared, repeatable configuration spread with the growth of server fleets: Luke Kanies started Puppet in 2005 and Chef was released in 2009, both managing what was installed and configured on machines. Cloud computing then made the machines themselves, along with networks, load balancers and databases, something you could create with an API call. On February 25, 2011, AWS launched CloudFormation, which builds a whole stack of resources from one JSON template in the right order. Its launch post compared a template to a baking recipe, where precise ratios give “repeatable, high-quality results every time”.
CloudFormation only covered AWS. Terraform, released in 2014, used the same declarative approach across many clouds through provider plugins, with a plan step that shows exactly what will change before anything does. When HashiCorp moved Terraform to a source-available licence in 2023, its community fork OpenTofu was taken in by the Linux Foundation, and in 2025 it joined the CNCF.
Why it’s built this way
- Declare the desired end state, not the steps
- Step-by-step scripts break when a machine isn’t in the state the script expects. Describing the end result lets the tool work out what to change, and running it again changes nothing, which is what makes it safe to repeat.
- Keep the definitions in version control
- Infrastructure files can be reviewed, diffed and rolled back like application code, and the same template can create identical environments for development, testing and production.
- Preview changes before applying them
- With whole networks and databases at stake, Terraform shows a plan of every create, update and destroy and acts only on approval, so mistakes can be caught in review instead of in production.
Timeline
- 1993
Mark Burgess creates CFEngine at the University of Oslo
- 2005
Luke Kanies starts Puppet
- 2009
Chef released
- 2011
AWS CloudFormation launches in February with JSON templates
- 2014
HashiCorp releases Terraform, cloud-agnostic, in July
- 2023
Terraform relicensed; OpenTofu fork joins the Linux Foundation
- Mark Burgess: Cfengine, a site configuration engine (USENIX Computing Systems, 1995)
- Mark Burgess: biography
- Wikipedia: CFEngine (history)
- GitHub: early Puppet commit by Luke Kanies (Apr 2005)
- GitHub: Chef 0.5.2 tag (Feb 2009)
- AWS News Blog: AWS CloudFormation launch (Feb 2011)
- HashiCorp: The story of HashiCorp Terraform with Mitchell Hashimoto
- Terraform docs: What is Terraform?
- Linux Foundation: Linux Foundation launches OpenTofu (Sept 2023)
- CNCF: OpenTofu (accepted April 23, 2025 at the Sandbox maturity level)
Sources14
- Terraform docs: What is Terraform? (write, plan, apply)
- Terraform docs: terraform plan command
- Terraform docs: State
- Terraform AWS provider docs: aws_sqs_queue
- AWS docs: What is AWS CloudFormation?
- AWS docs: What is the AWS CDK?
- Google Cloud docs: Infrastructure Manager overview
- Microsoft Learn: What is Bicep?
- Microsoft Learn: What are ARM templates?
- OpenTofu docs: What is OpenTofu?
- Pulumi docs: Concepts
- Packer docs: Introduction to Packer
- HCP Waypoint docs: What is HCP Waypoint?
- SST docs: What is SST