Skip to content

tfcensus report units ​

units lists the states in an index written by tfcensus inventory --save-index, with the accounts and regions of their resources. It is what the units tool of tfcensus mcp returns.

Usage ​

sh
tfcensus report units [flags]

Flags ​

FlagDescriptionTypeDefaultValuesConfig keyNotes
--indexstate index from tfcensus inventory --save-indexstring
--pathunit path glob, * matches / toostring
--statusstate status: ok, absent, encrypted, unsupported or errorstringok: read
absent: the key doesn't exist: the unit was never applied
encrypted: OpenTofu client-side encryption
unsupported: a state format other than version 4
error: reading failed

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.
130Interrupted by Ctrl-C (SIGINT) or a cancelled context.

All codes are listed on the exit codes page.

Examples ​

sh
tfcensus report units --index index.json.zst --path 'acme-live/prod/*'