tfcensus report scan
scan prints the per-account counts of a scan and its top findings, double-managed first, then unmanaged. --category lists another category instead.
With --from it reads a file from tfcensus scan --format json. Without it, it reads the newest snapshot in the scan cache and applies the current ownership rules to it, with no AWS call. A snapshot older than cache.ttl is used anyway, with a warning. It is what the scan_summary tool of tfcensus mcp returns.
Usage
sh
tfcensus report scan [flags]Flags
| Flag | Description | Type | Default | Values | Config key | Notes |
|---|---|---|---|---|---|---|
--account | AWS account ID | string | accounts.include | |||
--category | list this category: managed, double-managed, unmanaged, other-iac, aws-managed, derived, ignored or undetermined (default: double-managed and unmanaged) | string | managed: one state manages itdouble-managed: more than one state manages itunmanaged: no state manages itother-iac: CloudFormation, CDK, Pulumi or a Kubernetes controller owns itaws-managed: AWS created it, or it is a defaultderived: a child of a managed or derived resourceignored: an ownership rule ignores itundetermined: type unmapped, or the layer data is not enough | |||
--from | scan JSON (default: the newest scan cache snapshot) | string | ||||
--region | AWS region, or global | string | 35 values; shell completion lists them | regions | ||
--top | findings to list, 1 to 500 | int | 50 | |||
--type | CloudFormation or layer type glob, such as AWS::EC2::* | string |
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
| Code | Meaning |
|---|---|
| 0 | The command finished. With --fail-on, nothing matched. |
| 1 | The command failed: a read, a write, a child process or a check failed. |
| 2 | Wrong usage: an unknown command or flag, a bad value or argument, an invalid config file, or a prompt with no terminal. |
| 130 | Interrupted by Ctrl-C (SIGINT) or a cancelled context. |
All codes are listed on the exit codes page.
Examples
sh
tfcensus report scan --from scan.json --account 111111111111 --top 20
tfcensus report scan --category undetermined