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-onlyDid anything drift?
$ tofu apply -refresh-onlyAccept the drift into the register only. It asks first.
$ tofu plan -detailed-exitcodeExit code 0 = no changes, 1 = error, 2 = changes. Good for nightly drift checks.
Learn it in: Drift: someone clicked · Official docs