Metadata-Version: 2.4
Name: tfreadme
Version: 0.1.0
Summary: Generate Markdown reports from Terraform plans
Author: Aswin
License: MIT
Project-URL: Homepage, https://github.com/Aswin-00/tfreadme.git
Keywords: terraform,terraform-plan,iac,devops,aws,cloud,markdown,report,automation,cli
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: tabulate>=0.9.0

# 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

```text
terraform plan -out=tfplan
              │
              ▼
terraform show -json tfplan
              │
              ▼
     Terraform Plan Report
              │
              ▼
      README_TFPLAN.md
```

## Installation

Clone the repository:

```bash
git clone https://github.com/<your-username>/tfplan-report.git
cd tfplan-report
```

Install the package:

```bash
pip install .
```

Or install the dependency manually:

```bash
pip install tabulate
```

## Requirements

* Python 3.9+
* Terraform CLI
* tabulate

## Usage

Generate a Terraform plan:

```bash
terraform plan -out=tfplan
```

Generate the Markdown report:

```bash
tfreadme tfplan
```

or

```bash
python tfreadme.py tfplan
```

The tool generates:

```text
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

```text
.
├── pyproject.toml
├── requirements.txt
├── tfreadme.py
└── README.md
```

## How It Works

The tool:

1. Reads a Terraform binary plan file
2. Executes `terraform show -json`
3. Parses the JSON output
4. Classifies resource actions
5. Groups resources by operation
6. 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.
