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

pip:

pip install tfanalyze

pipx:

pipx 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.0.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.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tfanalyze-0.4.0.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.0.tar.gz
Algorithm Hash digest
SHA256 4a8c3f9b061bc2ea2974c482102d84303692db679693b80e522f37114fb486fb
MD5 327869b1af97609b8263fa37298e6791
BLAKE2b-256 a5f09bc8b274e1d937919eb65f72778b8c52b819404e943e2bf4ce131d2de1d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tfanalyze-0.4.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aaf44a9ae58df5cda4e9ccefa5d7eb042d44547eb235a79e4e56574ee3910875
MD5 588bc1507f1943ec555a405bcead088e
BLAKE2b-256 9eb3729fbaacf90edd18c8dbd72e38d946fc35de9f6a3f9acd37b4db8067f633

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