TodayTools

Terraform flashcards

Describe cloud servers, networks and databases in code, review the plan, and let Terraform build and change them safely.

Donate
Beginner friendly, starts from zero
Section
How to study
0
TerraformStart from zero · 1 of 11

What is Terraform, in one plain sentence?

Terraform is a tool where you write down the cloud things you want, like a server and a database, and it creates or changes them so the real world matches your files.

Write the wish list; Terraform makes it true.
Show again
11 left
Got it

Tap to turn over. Swipe right if you know it, left to see it again.

All topics

What you will learn

  1. Start from zero

    • What Terraform is and why4 cards
    • Key words4 cards
    • Where you meet it3 cards
  2. Core basics

    • Setup3 cards
    • The core loop4 cards
    • Resources and references2 cards
    • Variables and outputs3 cards
    • State basics5 cards
  3. Next steps

    • Remote state2 cards
    • Modules2 cards
    • Many copies and expressions5 cards
    • Environments and data3 cards
    • Lifecycle rules2 cards
    • Teamwork and CI2 cards
  4. Go deeper

    • Import and refactor4 cards
    • Drift2 cards
    • Secrets2 cards
    • Testing and checks2 cards
    • Policy and safety2 cards
    • Internals2 cards
    • Versions, licence and scale3 cards

Final test and certificate

10 questions drawn fresh from the whole topic, about 15 minutes. Sign in, score 80% or more and get a free certificate with your name and a public check link anyone can open, such as an employer or a teacher. Not signed in? Try a practice test from the cards.

Take the final test

About these cards

  • Reviewed 26 October 2026
  • CoversTerraform 1.15AWS provider 6.x
How these cards are made

Terraform at a glance

Terraform lets you write down the cloud things you want, like servers and databases, and then creates or changes them to match.

Terraform is like giving a builder a drawing of the house instead of shouting instructions. The builder compares the drawing with what stands today and only does the missing work.

Words you will meet

Infrastructure
The servers, networks, databases and storage an app runs on
Infrastructure as code
Writing that setup in text files instead of clicking in a web console
Provider
A plug-in that teaches Terraform to talk to one service, like AWS or GitHub
Resource
One thing Terraform manages, like one server or one storage bucket
Plan
A preview list of what Terraform will create, change or delete
Apply
Carrying out the plan for real
State
Terraform's notebook of what it built and the real IDs of those things
Module
A reusable folder of Terraform code, like a recipe you can use many times

The steps

  1. 1. Start from zero (11 cards): What infrastructure as code means, why teams use Terraform, and the eight words the rest of the topic builds on.
  2. 2. Core basics (17 cards): Install, providers, resources, the init, plan and apply loop, variables, outputs and how state works.
  3. 3. Next steps (16 cards): Remote state with locking, modules, count and for_each, data sources, environments, lifecycle rules and CI.
  4. 4. Go deeper (17 cards): Import, moved and removed blocks, drift, secrets and ephemeral values, testing, policy, large estates and the licence question.
All 11 cards in Start from zero
What is Terraform, in one plain sentence?
Terraform is a tool where you write down the cloud things you want, like a server and a database, and it creates or changes them so the real world matches your files.
What does "infrastructure as code" mean?
Instead of clicking through a cloud website to make a server, you describe it in a text file. The file can be saved, reviewed, copied and run again to get the same result.
What goes wrong when people set up servers by clicking?
Nobody remembers every click, so test and live drift apart, mistakes are hard to undo and a lost setup takes days to rebuild. Code fixes all three: it is written down and repeatable.
An everyday picture of how Terraform works?
Think of a shopping list and your fridge. Terraform reads the list (your files), checks the fridge (the real cloud), and buys only what is missing or throws out what is no longer on the list.
What are a provider and a resource?
A provider is a plug-in that knows how to talk to one service, like AWS. A resource is one thing that provider makes, like one storage bucket or one server.
What are plan and apply?
Plan shows a preview: what will be created, changed or deleted. Apply does it for real. You always read the plan before you apply.
What is state?
State is Terraform's notebook. It records each thing it built and its real ID in the cloud, so next time it knows what already exists.
What is a module?
A module is a folder of Terraform code you can reuse, like a recipe. One "website" module can make the same setup for test and live with different sizes.
Who uses Terraform at work?
Cloud and platform engineers, DevOps and site reliability teams, and more and more backend developers who own their own servers. Job posts often list it next to AWS, Docker and Kubernetes.
What does a tiny Terraform file look like?
A block says what kind of thing to make and gives it a name, then lists its settings. This one asks for a storage bucket called arjun-photos-2026.
What do you need before starting, and what will you be able to do after?
You need a terminal and a free cloud account to practise on. After this topic you can describe real infrastructure in code, review changes safely and share the work with a team.
Terraform cheatsheet

Daily commands

  • terraform init Get providers, set up backend
  • terraform fmt -recursive Format every file
  • terraform validate Check syntax and references
  • terraform plan -out=tfplan Preview and save the plan
  • terraform apply tfplan Apply exactly the saved plan
  • terraform output -json Print outputs for scripts
  • terraform console Try expressions live

State

  • terraform state list Everything tracked
  • terraform state show ADDR One resource in detail
  • terraform state pull > backup.tfstate Back up state
  • terraform plan -refresh-only Find drift
  • terraform plan -replace=ADDR Force a new copy
  • terraform force-unlock LOCK_ID Clear a stuck lock

Language

  • resource "TYPE" "NAME" {} Something Terraform manages
  • data "TYPE" "NAME" {} Read something that exists
  • variable "x" { type = string } Input
  • output "x" { value = ... } Value for people or other code
  • for_each = toset(var.names) One copy per name
  • count = var.on ? 1 : 0 Optional resource
  • { for k, v in m : k => v.id } Build a map

Refactor blocks

  • import { to = ADDR id = "real-id" } Adopt an existing resource
  • moved { from = OLD to = NEW } Rename without replace
  • removed { from = ADDR lifecycle { destroy = false } } Forget without deleting
  • lifecycle { prevent_destroy = true } Block deletion in plans
  • lifecycle { ignore_changes = [tags] } Leave a field alone

Backend and versions

  • required_version = ">= 1.10" Minimum Terraform
  • version = "~> 6.0" Any 6.x provider
  • backend "s3" { use_lockfile = true } S3 state with native lock
  • terraform init -upgrade Move to newest allowed versions
  • terraform providers lock -platform=linux_amd64 Add CI checksums
Donate