BM: Baca dalam Bahasa Melayu
World T3: State & Teams
Drift: someone clicked
You will learn: how plan spots changes made by hand, and how to fix them either way.
Checked with OpenTofu 1.13 on 1 Nov 2026
The problem
Last night Ben added “Maggi goreng” to menu.txt by hand. The blueprint still lists two dishes. What will tofu plan say?
Pick one answer.
Try it
Find out. Type tofu plan and read the + line.
Blueprint (your .tf files)init done
local_file.menurandom_pet.stall
Built (the state file)state #1
local_file.menurandom_pet.stall
- stall
- lucky-civet
Change a file, then run tofu plan to see what it means.
Hint
Plan only shows. It changes nothing.Watch
Tap the two lines that report a change made outside OpenTofu.
0 of 2 found
drift: The real building no longer matches the register, because someone changed it by hand.: the real building no longer matches the register. The local provider calls a changed file “deleted”. Cloud providers show what changed with ~.
Predict
Drift can go two ways. Sort each case.
Drag a card into a box. Or tap the card, then tap the box.
Try it
Ben’s dish was a mistake. Put the menu back: tofu apply, then type yes.
Blueprint (your .tf files)init done
local_file.menurandom_pet.stall
Built (the state file)state #1
local_file.menurandom_pet.stall
- stall
- lucky-civet
Change a file, then run tofu plan to see what it means.
Hint
tofu apply shows the plan first and waits for yes.Check
What does tofu apply -refresh-only do?
Pick one answer.
Check
A nightly job runs tofu plan -detailed-exitcode. Sort what each exit code means.
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now find drift with plan and fix it either way.
Go deeper (optional)
lifecycle { ignore_changes = [tags] } tells OpenTofu to stop caring about one argument that others change on purpose. Drift checks often run on a schedule in CI. tofu refresh is an old, deprecated twin of tofu apply -refresh-only -auto-approve. Use tofu apply -refresh-only: it asks before it writes.
Real mission
tofu init && tofu applytofu plan -refresh-onlytofu apply
0 of 4 steps done · Your ticks are saved.
Bahasa Melayu
Semalam Ben tambah “Maggi goreng” dalam menu.txt dengan tangan. Pelan masih senaraikan dua hidangan. Apa kata tofu plan?
Mari semak. Taip tofu plan dan baca baris +.
Drift (hanyut): bangunan sebenar sudah tak sepadan dengan daftar. Provider local panggil fail yang berubah “deleted”. Provider cloud tunjuk perubahannya dengan ~.
Drift boleh dibaiki dua arah. Susun setiap kes.
Hidangan Ben itu silap. Pulihkan menu: tofu apply, kemudian taip yes.
tofu apply tunjuk plan dahulu dan tunggu yes.Apa yang tofu apply -refresh-only buat?
Satu kerja malam jalankan tofu plan -detailed-exitcode. Susun maksud setiap kod keluar.
Kini anda boleh cari drift dengan plan dan baikinya dari mana-mana arah.
You finished this before. Practice is always welcome!
Official docs: tofu plan (-refresh-only, -detailed-exitcode) · tofu refresh · OpenTofu: lifecycle (ignore_changes)
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?