Supported versions
tfcensus runs terragrunt and terraform or OpenTofu in your units for discovery, drift, move and codify. It reads state and plan files itself. The table lists the oldest version of each tool it runs, the versions its end-to-end tests use, and the features that need a newer one.
| Tool | Oldest version | End-to-end tests run | Features that need a newer version |
|---|---|---|---|
| terragrunt | 1.0.0 | 1.2.2 | none |
| terraform | 1.5.0 | 1.17.2 | removed and import for_each (1.7.0), use_lockfile (1.10.0), resource identity (1.12.0), query (1.14.0) |
OpenTofu (tofu) | 1.6.0 | 1.13.9 | removed and import for_each (1.7.0), state encryption (1.7.0), removed lifecycle and use_lockfile (1.10.0), resource identity (1.12.0), query (never) |
tfcensus doctor prints the version of each tool it finds, with the features that version is too old for, and exits 1 when a tool is older than its minimum. A tool that isn't installed is reported and doesn't fail the run, because commands such as scan and audit backend don't run it.
The features in the table:
- Resource identity:
codifywrites import blocks by identity on terraform or OpenTofu 1.12 or later, and by ID on older versions. query:codify --querywrites list blocks forterraform query, which OpenTofu doesn't have.use_lockfile:audit backendreports units that still lock with DynamoDB only (LK-MODE).
Tools
- terragrunt 1.0 and later promise no breaking changes, so tfcensus supports every 1.x release. It doesn't support terragrunt before 1.0.
- terragrunt runs OpenTofu unless it's told otherwise. tfcensus passes the binary from
--tf-path(configbinaries.terraform, defaultterraform) on every call, so set it totofufor an OpenTofu fleet.--tg-pathsets the terragrunt binary. doctortells terraform and OpenTofu apart by the first line ofversionoutput, so aterraformname that points to OpenTofu is still reported as OpenTofu.
State and plan files
Reading state doesn't depend on the tool version. tfcensus reads every state of format version 4, which terraform 0.12 and later and every OpenTofu release write. A state of an older format shows as unsupported in inventory, and the other states are still read. Plan JSON is read by its format_version major, 1.x today, and unknown fields are ignored.
OpenTofu states with client-side encryption show as encrypted, with only serial and lineage. inventory --decrypt-with-tofu reads them through tofu show -json in the unit, which needs OpenTofu 1.7 or later.
The AWS provider
tfcensus doesn't run the AWS provider. Its type mapping comes from the provider source (type coverage). Matching by resource identity works for states that hold identity data, which terraform and OpenTofu 1.12 or later write with AWS provider 6.0 or later. Other states match by ARN and ID.