BM: Baca dalam Bahasa Melayu
World T1: Blueprints Β· Boss challenge
Build a tiny food court
You will learn: to run the whole loop on your own: init, plan, apply, change, destroy.
Checked with OpenTofu 1.13 on 1 Nov 2026
The problem
Boss: Kedai Kancil runs a tiny food court at Saturdayβs fair. You get the blueprint fresh from Git. What do you type first?
Pick one answer.
Try it
Build the food court: a stall name, a table, a board, a bell, a lamp. Use init, plan, then apply.
Blueprint (your .tf files)needs tofu init
local_file.boardnot built yetnull_resource.lampnot built yetrandom_integer.tablenot built yetrandom_pet.stallnot built yetterraform_data.bellnot built yet
Built (the state file)
Nothing built yet.
Change a file, then run tofu plan to see what it means.
Hint
tofu init, tofu plan, tofu apply, yes.Try it
Friday night, the boss changes the blueprint. Read the plan before anyone builds.
Read the plan. What will OpenTofu do to each resource?
+ create~ update in place- destroy-/+ replace
0 of 4 read
# local_file.menu + resource "local_file" "menu" { + content = <<-EOT Nasi lemak Teh tarik EOT + content_base64sha256 = (known after apply) + content_base64sha512 = (known after apply) + content_md5 = (known after apply) + content_sha1 = (known after apply) + content_sha256 = (known after apply) + content_sha512 = (known after apply) + directory_permission = "0777" + file_permission = "0777" + filename = "menu.txt" + id = (known after apply) }
What happens to local_file.menu?
# null_resource.lamp - resource "null_resource" "lamp" { - id = "1372104572265717479" -> null - triggers = { - "table" = "540" } -> null }
What happens to null_resource.lamp?
# random_pet.stall -/+ resource "random_pet" "stall" { ~ id = "gecko" -> (known after apply) ~ length = 1 -> 2 # forces replacement # (1 unchanged attribute hidden) }
What happens to random_pet.stall?
# terraform_data.bell ~ resource "terraform_data" "bell" { id = "c1275269-3f26-b993-2043-0c9fdd3dfdb7" ~ input = "ring" -> "ding dong" ~ output = "ring" -> (known after apply) }
What happens to terraform_data.bell?
The summary line shows when you finish.
Predict
The plan shows - next to null_resource.lamp. Why does the lamp go?
Pick one answer.
Try it
The plan looks right. Apply the new blueprint.
Blueprint (your .tf files)init done
local_file.boardlocal_file.menunot built yetrandom_integer.tablerandom_pet.stallterraform_data.bell
Built (the state file)state #1
local_file.boardnull_resource.lamprandom_integer.tablerandom_pet.stallterraform_data.bell
Change a file, then run tofu plan to see what it means.
Hint
tofu apply, then yes.Check
Your fair checklist. Put it in order.
First step at the top. Put these in order. Use the arrows, or drag.
- tofu plan and read every symbol
- tofu destroy when the fair is over
- Change the blueprint, plan again, apply again
- tofu init in the fresh folder
- tofu apply, then yes
Try it
Sunday night. The fair is over. Tear the food court down.
Blueprint (your .tf files)init done
local_file.boardlocal_file.menurandom_integer.tablerandom_pet.stallterraform_data.bell
Built (the state file)state #1
local_file.boardlocal_file.menurandom_integer.tablerandom_pet.stallterraform_data.bell
Change a file, then run tofu plan to see what it means.
Hint
tofu destroy, then yes. Careful: read the list first.You did it!
You can now build, change and tear down a blueprint on your own.
Go deeper (optional)
Real rep (optional): build this food court on your own machine. It uses only the random, local and null providers, so it costs nothing.
Real mission
mkdir fair && cd fairtofu inittofu plantofu applycat board.txttofu destroy
0 of 7 steps done Β· Your ticks are saved.
Bahasa Melayu
Boss: Kedai Kancil buka medan selera kecil di pesta hari Sabtu. Anda dapat pelan terus dari Git. Apa anda taip dulu?
Bina medan selera: nama gerai, meja, papan, loceng, lampu. Guna init, plan, kemudian apply.
tofu init, tofu plan, tofu apply, yes.Malam Jumaat, bos ubah pelan. Baca plan sebelum sesiapa membina.
Plan tunjuk - di sebelah null_resource.lamp. Kenapa lampu itu hilang?
Plan nampak betul. Apply pelan baru itu.
tofu apply, kemudian yes.Senarai semak pesta anda. Susun ikut urutan.
Malam Ahad. Pesta sudah tamat. Robohkan medan selera itu.
tofu destroy, kemudian yes. Hati-hati: baca senarainya dulu.Kini anda boleh bina, ubah dan robohkan pelan sendiri.
You finished this before. Practice is always welcome!
Official docs: tofu init Β· tofu plan Β· tofu apply Β· tofu destroy
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?