Skip to content
BENIBIX Learn

Terraform

Development☁️ DevOps & CloudInfrastructure as Code

Also known as HashiCorp Terraform, terraform plan, terraform apply, HCL

A tool that builds cloud setups from text files. The files say what should exist.

Think of it like

Think of it like a builder with a plan drawing. You change the drawing, and the builder changes the house to match.

Example

Jack adds one server to his Terraform file. The plan says one thing will be added. Two minutes after apply, the server is there.

Why it matters

The plan shows each change first. A typo cannot quietly wipe a database.

Definition

Terraform is a tool that builds cloud setups from text files written in HCL. You describe what should exist, like a server or a database. terraform plan shows what it will add, change or delete. terraform apply then makes it so. It works with all the big cloud providers and hundreds of other services.

Example code

console
$ terraform plan
...
Plan: 1 to add, 0 to change, 0 to destroy.
Terraform tells you what it will do before it does it.

Common mistake

Running apply without reading the plan. One wrong line can destroy and rebuild a server you meant to keep.

Key takeaways

  1. 1
    Describe the goal. Not the steps.
  2. 2
    Plan, then apply. See it before it happens.
  3. 3
    Many clouds. One tool for all.

Compare