Infrastructure as code
Describe your infrastructure in files and let a tool build it.
17 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.
Declarative templates
You write the end state in HCL, JSON or YAML, and the tool works out the changes.
tofu instead of terraform.
AWS CloudFormationAWSAWS’s own infrastructure-as-code service: describe resources in a JSON or YAML template and CloudFormation creates them as one stack, in order, and rolls back on failure.+1 AWS Serverless Application Model (SAM)General-purpose languages
Loops, functions and types from a real programming language, compiled down to a plan or a template.
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.Infrastructure from code
Application code asks for the databases, queues and buckets it uses, and the tool derives the infrastructure and permissions from that.
App and serverless frameworks
Describe an app’s functions, APIs and queues; the framework expands them into cloud resources.
serverless.yml file of functions and the events that trigger them into a CloudFormation stack, and deploys it with your code to AWS Lambda.Automation and governance platforms
Run plans and applies from Git for several IaC tools, with approvals, policies and drift checks around them.
Control planes on Kubernetes
Cloud resources as Kubernetes objects, reconciled continuously instead of on each run.
Images and portals
Observability as code
Dashboards, alerts and data sources kept in Git and applied like any other resource.
| Declarative templates | 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 | |
| Declarative templates | Open source | Cloud Native Computing FoundationCNCF · Sandbox | MPL 2.0 | 2026-10-06 | |
AWS CloudFormation | Declarative templates | Managed service on AWS | Amazon Web Services | Proprietary | 2026-10-23 |
| General-purpose languages | Open source | Pulumi Corporation | Apache 2.0 (the CLI, engine and SDKs); Pulumi Cloud is a commercial service | 2026-10-23 | |
AWS Cloud Development Kit (CDK) | General-purpose languages | Managed service on AWS | Amazon Web Services | Apache 2.0 | 2026-10-06 |
| Infrastructure from code | Open source | Encoretivity AB | MPL-2.0 (Encore Cloud is a paid service) | 2026-10-24 | |
| Infrastructure from code | Open source | Nitric Inc. | Apache 2.0 | 2026-10-24 | |
| Infrastructure from code | Open source | Winglang community (formerly Wing Cloud) | MIT (the Wing Console is source-available) | 2026-10-23 | |
| App and serverless frameworks | Open source | Anomaly Innovations | MIT | 2026-10-06 | |
| App and serverless frameworks | Commercial product | Serverless, Inc. | Proprietary since v4 (free below $2M annual revenue); MIT up to v3 | 2026-10-23 | |
| Automation and governance platforms | Commercial product | Spacelift, Inc. | Proprietary (the `spacectl` CLI and Terraform provider are MIT; Intent is Apache 2.0) | 2026-10-24 | |
| Control planes on Kubernetes | Open source | Cloud Native Computing FoundationCNCF · Graduated | Apache 2.0 | 2026-10-13 | |
| Images and portals | 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 | Images and portals | 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 |
| Observability as code | Open source | Grafana Labs | Apache 2.0 | 2026-10-23 |
Also used for infrastructure as code
Products of other kinds that are often used this way, grouped by what they are.
AWS Chalice | API frameworks | Managed service on AWS | Amazon Web Services | Apache 2.0 | 2026-10-23 |
| Database clients and design tools | Commercial product | Ariga Technologies | Open core: Community Edition is Apache 2.0; the standard binary adds proprietary features under the Atlas MSA, some of them paid (Atlas Pro) | 2026-10-23 |
What each provider calls it
- AWS
- CloudFormation, AWS CDK, AWS SAM for serverless apps
- Google Cloud
- Infrastructure Manager
- Azure
- Bicep, ARM templates
- Open source & others
- Terraform, OpenTofu, Pulumi; SST for full-stack apps on AWS and Cloudflare; the Serverless Framework for Lambda apps; Crossplane for control planes on Kubernetes; 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.terraform destroy removes it all. Useful as a pattern for disposable chaos test environments; it is Gremlin’s own tutorial, last updated in 2018 and flagged by Gremlin as possibly out of date, and it hardcodes agent credentials in user data, which it says not to do long term.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
