Terraform flashcards
Describe cloud servers, networks and databases in code, review the plan, and let Terraform build and change them safely.
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.
Tap to turn over. Swipe right if you know it, left to see it again.
What you will learn
Start from zero
- What Terraform is and why4 cards
- Key words4 cards
- Where you meet it3 cards
Core basics
- Setup3 cards
- The core loop4 cards
- Resources and references2 cards
- Variables and outputs3 cards
- State basics5 cards
Next steps
- Remote state2 cards
- Modules2 cards
- Many copies and expressions5 cards
- Environments and data3 cards
- Lifecycle rules2 cards
- Teamwork and CI2 cards
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 testAbout these cards
- Reviewed 26 October 2026
- CoversTerraform 1.15AWS provider 6.x
Checked against
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. 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. Core basics (17 cards): Install, providers, resources, the init, plan and apply loop, variables, outputs and how state works.
- 3. Next steps (16 cards): Remote state with locking, modules, count and for_each, data sources, environments, lifecycle rules and CI.
- 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 initGet providers, set up backendterraform fmt -recursiveFormat every fileterraform validateCheck syntax and referencesterraform plan -out=tfplanPreview and save the planterraform apply tfplanApply exactly the saved planterraform output -jsonPrint outputs for scriptsterraform consoleTry expressions live
State
terraform state listEverything trackedterraform state show ADDROne resource in detailterraform state pull > backup.tfstateBack up stateterraform plan -refresh-onlyFind driftterraform plan -replace=ADDRForce a new copyterraform force-unlock LOCK_IDClear a stuck lock
Language
resource "TYPE" "NAME" {}Something Terraform managesdata "TYPE" "NAME" {}Read something that existsvariable "x" { type = string }Inputoutput "x" { value = ... }Value for people or other codefor_each = toset(var.names)One copy per namecount = var.on ? 1 : 0Optional resource{ for k, v in m : k => v.id }Build a map
Refactor blocks
import { to = ADDR id = "real-id" }Adopt an existing resourcemoved { from = OLD to = NEW }Rename without replaceremoved { from = ADDR lifecycle { destroy = false } }Forget without deletinglifecycle { prevent_destroy = true }Block deletion in planslifecycle { ignore_changes = [tags] }Leave a field alone
Backend and versions
required_version = ">= 1.10"Minimum Terraformversion = "~> 6.0"Any 6.x providerbackend "s3" { use_lockfile = true }S3 state with native lockterraform init -upgradeMove to newest allowed versionsterraform providers lock -platform=linux_amd64Add CI checksums