# Terraform

URL: https://softwaredictionary.org/terms/terraform
Category: DevOps & Cloud
Last updated: 2026-10-03
Pronunciation: TAIR-uh-form

In short: Terraform is an infrastructure-as-code tool: you describe cloud resources in configuration files, and one command creates or updates them to match.

## What is Terraform?

Terraform was released by HashiCorp in 2014. Instead of clicking through a cloud console, you write what you want, for example two virtual machines, a database and a load balancer, in files using HCL, HashiCorp Configuration Language. Terraform reads those files and talks to the cloud's API to make reality match. Because the files live in Git, infrastructure gets reviews, history and rollbacks just like code.

Its workflow has two key steps. `terraform plan` compares the configuration with what exists and shows exactly what would be created, changed or destroyed. `terraform apply` then carries out that plan. Terraform remembers what it manages in a state file, which is usually stored remotely so a team shares one view of the infrastructure.

Terraform works with almost any platform through providers: plugins for AWS, Azure, Google Cloud, Kubernetes, Cloudflare, GitHub, databases and hundreds more. Reusable modules package common setups, such as a standard network, so teams don't rebuild them each time. The configuration is declarative: you describe the end state, and Terraform works out the order of the steps.

A common misconception is that Terraform configures what runs inside servers. It mainly creates and connects the resources themselves; installing packages and editing files on machines is the job of configuration tools such as Ansible, or of container images. In 2023 HashiCorp moved Terraform to a source-available license, and the community forked the last open-source version as OpenTofu, which works in largely the same way.

## Key takeaways

- Terraform describes cloud infrastructure as code, in HCL files.
- terraform plan previews changes; terraform apply makes them.
- A state file records which real resources Terraform manages.
- Providers connect it to AWS, Azure, Google Cloud, Kubernetes and more.
- OpenTofu is an open-source fork that works in much the same way.

## Example: Declaring a storage bucket on AWS

```hcl
provider "aws" {
  region = "eu-central-1"
}

resource "aws_s3_bucket" "assets" {
  bucket = "example-site-assets"

  tags = {
    Environment = "production"
  }
}

# terraform plan   -> shows: 1 to add
# terraform apply  -> creates the bucket
```

## Frequently asked questions

**Is Terraform free?**

The Terraform CLI can be used free of charge, but since 2023 it is under the Business Source License, which restricts offering it as a competing product. OpenTofu is a fully open-source fork. HashiCorp also sells HCP Terraform, a managed service.

**What is the difference between Terraform and Ansible?**

Terraform mainly creates and manages infrastructure, such as networks, machines and databases, from a declared end state. Ansible mainly configures machines, installing software and changing settings over SSH. Many teams use both.

**What is the Terraform state file?**

A file in which Terraform records the real resources it manages and their settings. It lets Terraform work out what has changed, and teams usually keep it in remote storage with locking so that two people can't apply changes at once.

## Sources

- [Terraform documentation: What is Terraform?](https://developer.hashicorp.com/terraform/intro)

---

Software Dictionary: https://softwaredictionary.org/ · https://softwaredictionary.org/llms.txt
