Terraform is an Infrastructure as Code (IaC) tool from HashiCorp (part of IBM since 2025). Instead of clicking servers, networks, databases and DNS records together in a cloud console, you describe them in configuration files. Terraform then works out what needs to be created, changed or removed, and does it for you, on AWS, Azure, Google Cloud and hundreds of other platforms.
How does Terraform work?
- Configuration in HCL: resources are declared in HashiCorp Configuration Language, a readable declarative format stored in Git like any other code.
- Providers: plugins that translate the configuration into API calls for a platform, such as AWS, Azure, Cloudflare, GitHub or Kubernetes.
- Plan and apply:
terraform planshows exactly what will change;terraform applycarries it out. - State: Terraform keeps a state file with the real infrastructure it manages, usually stored remotely with locking so a team can work on it safely.
- Modules: reusable building blocks, for example a standard network or database setup used in every environment.
Why use Infrastructure as Code?
With infrastructure in code, environments are reproducible: test, acceptance and production are built from the same definitions, and a new environment or a disaster recovery takes minutes instead of days. Every change goes through version control and review, so you know who changed what and why. And because the plan step shows the impact in advance, mistakes are caught before they reach production. Combined with CI/CD, infrastructure changes are deployed as reliably as application code.
Terraform vs. OpenTofu, CloudFormation and Ansible
OpenTofu is an open-source fork of Terraform, created after HashiCorp moved Terraform to the Business Source License in 2023; it is largely compatible. AWS CloudFormation and Azure Bicep do the same job but only for their own cloud, while Terraform works across platforms. Ansible is mainly used to configure servers and software; it is often combined with Terraform, which creates the infrastructure.
Terraform in practice
We use Terraform to set up cloud infrastructure for client platforms: networks, servers, managed databases, container platforms such as Kubernetes, DNS and monitoring, all in code. See our Terraform services and the case study scalable AWS infrastructure.
Frequently Asked Questions about Terraform
Is Terraform free?
The Terraform CLI is free to use, including commercially, under the Business Source License, with restrictions only for building competing products. HashiCorp sells paid plans of HCP Terraform for teams. OpenTofu is a fully open-source alternative.
Is Terraform a programming language?
Not in the usual sense. HCL is a declarative configuration language: you describe the desired end state, and Terraform determines the steps to get there.
What is the Terraform state file?
A file in which Terraform records which real resources belong to the configuration. It must be stored safely and shared within the team, typically in remote storage with locking, because it can contain sensitive values.
Can Terraform manage existing infrastructure?
Yes. Existing resources can be imported into Terraform, so a manually built environment can be brought under code step by step.