Generate Markdown reports from Terraform plans
Project description
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.
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 tfreadme-0.1.0.tar.gz.
File metadata
- Download URL: tfreadme-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d320b2ec509a455b88f5a3b70ce01619d45fe430f8540a7cd9f4f161520bd95
|
|
| MD5 |
085140d62a3de06425c5b83b36bf5e9d
|
|
| BLAKE2b-256 |
a139267c2c73d3db8e9a2964c79405e1a6005308b04c093c334ada9f953416cf
|
File details
Details for the file tfreadme-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tfreadme-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a590d738fd127162a23f2e6cd6c820f17e5e31036424589a46db8d32bba69aff
|
|
| MD5 |
fad9c499a8902e69fe45f18ca53c9658
|
|
| BLAKE2b-256 |
ef993213e357d5892a1fb827272a897aa529737c659d6b52a99160facdc0fe2b
|