Skip to main content

Lightweight command-line utility to analyze Terraform plan files

Project description

Build Coverage

tfanalyze

Do you ever look at a Terraform plan with 15 deletions and 43 updates and wonder how you're supposed to safely perform an apply? Fear not! tfanalyze has your back.

tfanalyze is a lightweight command-line utility to summarize the contents of a Terraform plan. It allows you to quickly see what resources are being created, updated, or destroyed, and what changes are being made to them.

Installation

uv (recommended):

uv tool install tfanalyze

pipx:

pipx install tfanalyze

pip (not recommended for a global install):

pip install tfanalyze

Usage

Supply tfanalyze with a single Terraform plan:

terraform plan -out=plan.tfplan
tfanalyze plan.tfplan

This will output a summary of the plan, showing the resources that are being created, updated, or destroyed. You can list only the resources that would be destroyed by adding the --destroy-only flag.

Development

Lifecycle tasks can be performed using the provided Taskfile. black, isort and autoflake are used to ensure consistent formatting.

Tests exist and can be invoked with pytest. In order to generate a test coverage report, simply run task test.

Additionally, check the e2e/ directory to validate tfanalyze against real Terraform plans. You can generate plans for different scenarios by using the provided bash script:

# You'll want to create an initial baseline setup
cd e2e
terraform init

./generate-plans.sh destroy
./generate-plans.sh update

A minimal baseline state exists at e2e/state/e2e.tfstate which is re-used by all scenarios.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tfanalyze-0.4.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tfanalyze-0.4.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file tfanalyze-0.4.1.tar.gz.

File metadata

  • Download URL: tfanalyze-0.4.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for tfanalyze-0.4.1.tar.gz
Algorithm Hash digest
SHA256 e97d37356b8e6aaea982d803ba07136264a9195d38b862ff30c99fe284d7cb8c
MD5 921a7cae3fee3bf627df1b2895096bd4
BLAKE2b-256 093f9f47d057274bd0c40dbe71c919ca84cff3f09318eba4fe36a102f5212bc1

See more details on using hashes here.

File details

Details for the file tfanalyze-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: tfanalyze-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for tfanalyze-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 285af0bbe0fd73c008998259cebd92f2349281e89633c9be4e70eea165904d8e
MD5 ca4aa216e9a723606aaa55a0036344c4
BLAKE2b-256 5e2efbf4e44dca7daae21b6d82013a67636723936fc3f492c17dfab4672f1cb0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page