Terraform
Declarative infrastructure as code for any cloud. Terraform, from HashiCorp, is a tool for describing infrastructure in declarative configuration files (HCL) and applying the changes through provider APIs. It keeps a state file of what it manages and shows a plan before making changes. Providers exist for every major cloud and many SaaS products; OpenTofu is a community fork with a compatible workflow.
When it is the right choice
- You want every cloud resource defined, reviewed and versioned in Git
- You manage several environments or clouds with the same patterns
- You need a plan of every change before it is applied
- Note that Terraform moved to the Business Source Licence in 2023; check whether it affects you or consider OpenTofu
How we use it
- Write modular Terraform with remote state, locking and separate environments
- Run plan on every pull request and apply only from the pipeline after review
- Use AI to draft changes and explain plans, with a human approving every apply
- Detect drift on a schedule and bring manual changes back into code
Where it fits in our work
Related articles
Configuration Management Tools in DevOps: Which Layer Each One OwnsTerraform, Ansible, Puppet, Chef, Salt, Helm and Argo CD all claim to manage configuration. Here is which layer each one should own, and how we combine them without overlap or drift.
Cloud & DevOps Security: Where We Start With Every ClientA practical order for cloud and DevOps security: identity first, then the pipeline, the network, the workloads and the logs, with the checks we run in the first week.
Cloud Infrastructure Provisioning: Bringing What You Already Have Under CodeCloud infrastructure provisioning for teams that already have a cloud: inventory, import into Terraform without recreating anything, plans reviewed before every apply, and drift caught early.Terraform: frequently asked
Terraform or OpenTofu?
Both use the same language and workflow. OpenTofu is open source under the Linux Foundation; Terraform has HashiCorp's licence and commercial products. We work with either.
How do we bring existing resources under Terraform?
Terraform can import existing resources into state. We do it in stages, checking that each plan shows no unwanted changes.
Running Terraform, or deciding whether to? Tell us what you have; the first consultation is free.
Let's talk »