Skip to content

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 md

Subcommands ​

CommandDescription
tfcensus auditAudit state backends
tfcensus cacheInspect or clear the probe and scan caches
tfcensus codifyWrite import blocks for unmanaged resources from a scan report
tfcensus completionGenerate the autocompletion script for the specified shell
tfcensus configInspect and validate configuration
tfcensus doctorCheck tool versions, AWS credentials and the inventory layers of each account and region
tfcensus driftFind drift between the units' state and AWS
tfcensus inventoryRead each unit's state: versions, providers, resource counts, serial and lineage
tfcensus mcpServe units, inventory, whois, scan_summary, audit_findings and drift_summary to an MCP client over stdio
tfcensus moveMove resources between the states of Terragrunt units
tfcensus notifyPublish saved scan, drift and audit reports to Slack, GitHub, Bitbucket or files
tfcensus reportRender saved scan, drift, audit and index files without collecting again
tfcensus rulesWork with ownership rules
tfcensus scanFind AWS resources that no unit manages
tfcensus unitsList units with their state backend, target account and region
tfcensus versionPrint version and build information
tfcensus whoisShow which units manage an AWS resource