tfcensus
tfcensus lists Terraform/OpenTofu and Terragrunt units and their state, finds AWS resources that no unit manages, and audits state backends. It is read-only by default.
stdout carries data, stderr carries logs. Use --format json for scripting.
Docs: https://tfcensus.sasskovacs.dev.
Usage
sh
tfcensus <command>The global flags work with every command.
Examples
sh
tfcensus doctor --profile 'acme-*'
tfcensus units
tfcensus scan --profile 'acme-*' --fail-on unmanaged
tfcensus audit backend --format mdSubcommands
| Command | Description |
|---|---|
| tfcensus audit | Audit state backends |
| tfcensus cache | Inspect or clear the probe and scan caches |
| tfcensus codify | Write import blocks for unmanaged resources from a scan report |
| tfcensus completion | Generate the autocompletion script for the specified shell |
| tfcensus config | Inspect and validate configuration |
| tfcensus doctor | Check tool versions, AWS credentials and the inventory layers of each account and region |
| tfcensus drift | Find drift between the units' state and AWS |
| tfcensus inventory | Read each unit's state: versions, providers, resource counts, serial and lineage |
| tfcensus mcp | Serve units, inventory, whois, scan_summary, audit_findings and drift_summary to an MCP client over stdio |
| tfcensus move | Move resources between the states of Terragrunt units |
| tfcensus notify | Publish saved scan, drift and audit reports to Slack, GitHub, Bitbucket or files |
| tfcensus report | Render saved scan, drift, audit and index files without collecting again |
| tfcensus rules | Work with ownership rules |
| tfcensus scan | Find AWS resources that no unit manages |
| tfcensus units | List units with their state backend, target account and region |
| tfcensus version | Print version and build information |
| tfcensus whois | Show which units manage an AWS resource |