# Terraform

> A popular tool for describing cloud infrastructure in files and creating it for you.

- Level: Intermediate
- Topics: Cloud
- URL: https://tidbit.legios.com.ar/terraform/
- In Spanish: [Terraform](https://tidbit.legios.com.ar/es/terraform/)

**Terraform** is a tool for infrastructure as code, created by HashiCorp (now part of IBM) and released in 2014. You write files ending in `.tf` that say what you want, for example "a server of this size, a bucket with this name, a database in this network", and Terraform talks to the cloud to make it real.

The everyday loop has two commands. `terraform plan` compares your files with what exists and shows a list of changes it would make: create this, modify that, delete this other thing. `terraform apply` carries them out. To know what already exists, Terraform keeps a **state file**, a record of every resource it manages; teams store it in a shared place so two people do not change the same thing at once.

Its big draw is that one language works for many platforms. Plugins called **providers** connect it to AWS, Azure, Google Cloud, and hundreds of other services, from DNS to monitoring tools. In 2023 HashiCorp changed Terraform's license to one that is no longer open source, and part of the community forked it into **OpenTofu**, which works almost the same way.

## An analogy

Like an architect's blueprint plus a builder who reads it. You change the drawing, the builder tells you exactly which walls will go up or come down, and only after you agree does the work start.

## Keep in mind

- You describe the desired result; Terraform works out the steps.
- `plan` shows the changes before `apply` makes them.
- The state file is Terraform's memory of what it built; losing it causes real trouble.
- OpenTofu is an open source fork that works almost the same way.

## Go deeper

- [What is Terraform? (official docs)](https://developer.hashicorp.com/terraform/intro)
- [Terraform on Wikipedia](https://en.wikipedia.org/wiki/Terraform_(software))

## Related terms

- [Infrastructure as code](https://tidbit.legios.com.ar/infrastructure-as-code/): Describing servers, networks and databases in files instead of clicking.
- [IBM](https://tidbit.legios.com.ar/ibm/): A century-old computer company that sells software, consulting and mainframes.
- [Server](https://tidbit.legios.com.ar/server/): A computer whose job is to answer requests from other computers, all day, every day.
- [Database](https://tidbit.legios.com.ar/database/): An organized store of data that programs can search and update safely.
- [Cloud computing](https://tidbit.legios.com.ar/cloud-computing/): Renting computers over the internet instead of buying your own.
- [Microsoft](https://tidbit.legios.com.ar/microsoft/): The company of Windows and Office, now just as much a cloud company with Azure.
- [Google Cloud](https://tidbit.legios.com.ar/google-cloud/): Google's cloud business: computing, storage, data and AI services rented by the hour.
- [DNS](https://tidbit.legios.com.ar/dns/): The internet's phone book: it turns names like wikipedia.org into IP addresses.
