Terraform Plan Report Generator
Generate clean, human-readable Markdown reports from Terraform plan files.
This utility converts the output of terraform show -json into a structured Markdown report that is easier to review during infrastructure changes, pull requests, and CI/CD pipelines.
Features
-
Generate Markdown reports from Terraform plan files
-
Summary of resource actions
- CREATE
- UPDATE
- DELETE
- REPLACE
-
Resource type summary
-
Friendly resource name detection
-
Resource ID extraction
-
Terraform resource address listing
-
Collapsible sections for improved readability
-
Lightweight and dependency-minimal
Example Workflow
terraform plan -out=tfplan
│
▼
terraform show -json tfplan
│
▼
Terraform Plan Report
│
▼
README_TFPLAN.md
Installation
Clone the repository:
git clone https://github.com/<your-username>/tfplan-report.git
cd tfplan-report
Install the package:
pip install .
Or install the dependency manually:
pip install tabulate
Requirements
- Python 3.9+
- Terraform CLI
- tabulate
Usage
Generate a Terraform plan:
terraform plan -out=tfplan
Generate the Markdown report:
tfreadme tfplan
or
python tfreadme.py tfplan
The tool generates:
README_TFPLAN.md
Sample Output
Plan Summary
| Action | Count |
|---|---|
| CREATE | 12 |
| UPDATE | 5 |
| DELETE | 2 |
| REPLACE | 1 |
Resource Type Summary
| Resource Type | Count |
|---|---|
| aws_instance | 8 |
| aws_security_group | 4 |
| aws_iam_role | 2 |
CREATE
| Name | Type | Resource ID | Terraform Address |
|---|---|---|---|
| web-server | aws_instance | N/A | aws_instance.web |
Project Structure
.
├── pyproject.toml
├── requirements.txt
├── tfreadme.py
└── README.md
How It Works
The tool:
- Reads a Terraform binary plan file
- Executes
terraform show -json - Parses the JSON output
- Classifies resource actions
- Groups resources by operation
- Generates a clean Markdown report
Current Capabilities
- Parse Terraform plan files
- Generate Markdown summaries
- Count resources by action
- Count resources by type
- Extract resource names
- Extract resource IDs
- Display Terraform addresses
- Produce review-friendly output
Technologies Used
- Python
- Terraform
- JSON
- tabulate
License
MIT License
Author
Developed by Aswin as a practical DevOps automation tool to simplify Terraform plan reviews and improve infrastructure change visibility.
Metadata
Release files for tfreadme 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tfreadme-0.1.0.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tfreadme-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.9 kB
Release files / tfreadme-0.1.0.tar.gz
| Download URL | tfreadme-0.1.0.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d320b2ec509a455b88f5a3b70ce01619d45fe430f8540a7cd9f4f161520bd95
|
|
BLAKE2b-256 checksum How to use checksums |
a139267c2c73d3db8e9a2964c79405e1a6005308b04c093c334ada9f953416cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.1
|
Release files / tfreadme-0.1.0-py3-none-any.whl
| Download URL | tfreadme-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a590d738fd127162a23f2e6cd6c820f17e5e31036424589a46db8d32bba69aff
|
|
BLAKE2b-256 checksum How to use checksums |
ef993213e357d5892a1fb827272a897aa529737c659d6b52a99160facdc0fe2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.1
|