Skip to content

tfcensus move rollback ​

This command writes to S3 or DynamoDB. Every other command is read-only: see the safety model.

rollback restores every unit of each applied block to the S3 object version it had before apply pushed it, byte for byte, newest block first and the source before its destinations. It takes the backend lock, copies the old version over the current one, fixes the DynamoDB digest, and marks the history records as rolled back. A unit that didn't exist before is deleted again.

rollback stops when a state changed after the push, unless --force is set.

Usage ​

sh
tfcensus move rollback <migration-file> [flags]

Arguments ​

ArgumentRequiredRepeatable
migration-fileyesno

Flags ​

FlagDescriptionTypeDefaultValuesConfig keyNotes
--blockrun only these blocks (default: all, in file order)list, repeatable
--forcerestore even when a state changed after the pushbool
--reporepository root that the file's unit paths are relative tostring.
--varset var.NAME in the migration file, as NAME=VALUEstring, repeatable
--yesdon't ask for confirmationbool

The global flags work with every command.

Output formats ​

--format accepts tty, plain, json. Without it, the format is tty when stdout is a terminal and plain otherwise. Formats are described on the global flags page.

Exit codes ​

CodeMeaning
0The command finished. With --fail-on, nothing matched.
1The command failed: a read, a write, a child process or a check failed.
2Wrong usage: an unknown command or flag, a bad value or argument, an invalid config file, or a prompt with no terminal.
3A --fail-on gate matched. The report is still written.
4Credentials were missing or rejected for every source the command needed.
130Interrupted by Ctrl-C (SIGINT) or a cancelled context.

All codes are listed on the exit codes page.

Examples ​

sh
tfcensus move rollback migrations/split_network.hcl
tfcensus move rollback migrations/split_network.hcl --block split_network --var env=prod