Skip to content

tfcensus report inventory ​

inventory counts the managed resource instances in an index written by tfcensus inventory --save-index, per unit and TF type, with the instances another state also manages. It is what the inventory tool of tfcensus mcp returns.

Usage ​

sh
tfcensus report inventory [flags]

Flags ​

FlagDescriptionTypeDefaultValuesConfig keyNotes
--accountAWS account IDstringaccounts.include
--indexstate index from tfcensus inventory --save-indexstring
--regionAWS regionstring34 values; shell completion lists themregions
--typeTF resource type glob, such as aws_iam_*string
--unitunit path glob, * matches / toostring

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 inventory --index index.json.zst --account 111111111111 --type 'aws_iam_*'