You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?
Terraform & OpenTofu commands
One page per command. What it does, when to use it, how risky it is.
The loop: init, plan, apply
tofu initGets the providers a blueprint needs and writes the lock file.Risk: Safetofu planShows what apply would do: + create, ~ change, - destroy, -/+ replace. Changes nothing.Risk: Safetofu applyBuilds or changes real things to match the blueprint. It shows the plan and asks first.Risk: Carefultofu destroyDeletes every real thing this blueprint built. It asks first.Risk: Can lose work
Check and tidy
tofu fmtTidies .tf files: spaces, indents and lined-up = signs. Same meaning.Risk: Safetofu validateChecks the blueprint for mistakes: typos, wrong names, missing settings.Risk: Safetofu versionPrints the OpenTofu version, and the providers this folder uses.Risk: Safetofu providers lockWrites provider checksums into the lock file, for the platforms you name.Risk: Safetofu showPrints the register, or a saved plan, in a readable way. With -json, for robots like policy and cost checks.Risk: Safe
State
tofu state listLists every thing in the register (the state), one address per line.Risk: Safetofu state showPrints every saved detail of one thing in the register. Sensitive values stay hidden.Risk: Safetofu state rmMakes OpenTofu forget a thing. The real thing stays, but nobody manages it any more.Risk: Carefultofu state mvRenames a thing inside the register only. Nothing real changes.Risk: Carefultofu importAdopts one thing that was built by hand, straight into the register, with no plan first.Risk: Carefultofu planShows what changed outside OpenTofu (drift), and changes nothing.Risk: Safetofu force-unlockRemoves a stuck lock from the register, using the ID from the lock error.Risk: Careful
Workspaces and outputs
tofu outputPrints the outputs the blueprint shared, read from the state file.Risk: Safetofu workspace listManages extra registers for the same blueprint and backend.Risk: Careful