Lightweight command-line utility to analyze Terraform plan files
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e97d37356b8e6aaea982d803ba07136264a9195d38b862ff30c99fe284d7cb8c
|
|
| MD5 |
921a7cae3fee3bf627df1b2895096bd4
|
|
| BLAKE2b-256 |
093f9f47d057274bd0c40dbe71c919ca84cff3f09318eba4fe36a102f5212bc1
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
285af0bbe0fd73c008998259cebd92f2349281e89633c9be4e70eea165904d8e
|
|
| MD5 |
ca4aa216e9a723606aaa55a0036344c4
|
|
| BLAKE2b-256 |
5e2efbf4e44dca7daae21b6d82013a67636723936fc3f492c17dfab4672f1cb0
|