World map

 

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.menu
  • random_pet.stall

Built (the state file)state #1

  • local_file.menu
  • random_pet.stall
stall
lucky-civet
Blueprint: 2 resources. Built: 2.

Change a file, then run tofu plan to see what it means.

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.menu
      • random_pet.stall

      Built (the state file)state #1

      • local_file.menu
      • random_pet.stall
      stall
      lucky-civet
      Blueprint: 2 resources. Built: 2.

      Change a file, then run tofu plan to see what it means.

      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

            1. tofu init && tofu apply
            2. tofu plan -refresh-only
            3. tofu apply

            0 of 4 steps done · Your ticks are saved.