Belajar Sendiri

Commands

tofu plan -refresh-only

tofu plan -refresh-only

Risk: Safe

What it does

Shows what changed outside OpenTofu (drift), and changes nothing.

When to use it

When you suspect someone clicked, or a file was edited by hand.

Example

$ tofu plan -refresh-only

Did anything drift?

$ tofu apply -refresh-only

Accept the drift into the register only. It asks first.

$ tofu plan -detailed-exitcode

Exit code 0 = no changes, 1 = error, 2 = changes. Good for nightly drift checks.