Skip to content

Commit 4c567c5

Browse files
committed
Adjusting readme and setup files to the new project data
1 parent 40d876c commit 4c567c5

File tree

2 files changed

+61
-19
lines changed

2 files changed

+61
-19
lines changed

README.md

Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# TFSumPy - Terraform Plan Analyzer
22

3+
[![CI](https://github.com/rafaelherik/tfsumpy/actions/workflows/ci.yaml/badge.svg)](https://github.com/rafaelherik/tfsumpy/actions/workflows/ci.yaml)
4+
35
TFSumPy is a Python-based tool that analyzes Terraform plan files to provide a clear summary of infrastructure changes and identify potential risks. It helps DevOps teams review infrastructure changes more effectively by:
46

57
- Summarizing resource changes (create, update, delete)
@@ -13,14 +15,16 @@ TFSumPy is a Python-based tool that analyzes Terraform plan files to provide a c
1315
- ⚠️ Identifies high-risk changes (deletions of critical resources, security group modifications)
1416
- 🔒 Automatically redacts sensitive information (credentials, IPs, resource names)
1517
- 📊 Provides clear summary statistics
16-
- 🛡️ Supports both pre and post Terraform 0.12 plan formats
18+
- 🛡️ Supports Terraform 1.0+ plan formats
19+
- 📂 Module-aware resource grouping
20+
- 🔄 Detailed attribute change tracking
1721

1822
## Installation
1923

2024
Currently, TFSumPy can only be installed from source:
2125

2226
```bash
23-
git clone https://github.com/notry-cloud/tfsumpy.git
27+
git clone https://github.com/rafaelherik/tfsumpy.git
2428
cd tfsumpy
2529
pip install .
2630
```
@@ -37,13 +41,34 @@ terraform show -json tfplan > plan.json
3741
Then analyze the plan using TFSumPy:
3842

3943
```bash
40-
# Using default rules
44+
# Basic usage
4145
tfsumpy plan.json
4246

47+
# Show resources grouped by module
48+
tfsumpy plan.json --show-module
49+
50+
# Show detailed attribute changes
51+
tfsumpy plan.json --show-changes
52+
4353
# Using custom rules configuration
4454
tfsumpy plan.json --config rules_config.json
55+
56+
# Enable debug logging
57+
tfsumpy plan.json --debug
58+
59+
# Show only specific sections
60+
tfsumpy plan.json --risks --details
4561
```
4662

63+
### Command Line Options
64+
65+
- `--show-module`: Group resources by their Terraform module
66+
- `--show-changes`: Display detailed attribute changes for resources
67+
- `--risks`: Show only the risk assessment section
68+
- `--details`: Show only the resource details section
69+
- `--debug`: Enable debug logging
70+
- `--config`: Specify a custom rules configuration file
71+
4772
### Custom Rules Configuration
4873

4974
You can customize the analysis rules by creating a JSON configuration file. Here's an example structure:
@@ -81,34 +106,51 @@ The configuration file allows you to define:
81106
- `sensitive_patterns`: Regular expressions to identify and redact sensitive information
82107
- `risk_rules`: Patterns to identify high and medium risk changes
83108

109+
## Example Output
110+
111+
```
84112
Infrastructure Change Analysis
85113
==============================
86114
Total Changes: 5
87115
Create: 2
88116
Update: 2
89117
Delete: 1
90118
91-
Risk Assessment:
119+
Changes by Module:
120+
root:
121+
Create: 1
122+
Update: 1
123+
module.storage:
124+
Create: 1
125+
Update: 1
126+
Delete: 1
92127
128+
Risk Assessment:
93129
High Risks:
94130
- High risk: Security-related configuration change
95131
Medium Risks:
96-
- Medium risk: Version change could cause compatibility issues
132+
- Medium risk: Version change could cause compatibility issues
133+
97134
Resource Details:
98-
- CREATE aws_s3_bucket: project-storage-[REDACTED]
99-
- UPDATE aws_security_group: app-sg-[REDACTED]
100-
- UPDATE aws_ecs_service: api-service
101-
- DELETE aws_iam_role: legacy-role
102-
- CREATE aws_lambda_function: processor-function
135+
Module: root
136+
CREATE aws_s3_bucket: project-storage-[REDACTED]
137+
UPDATE aws_security_group: app-sg-[REDACTED]
138+
~ ingress = [] -> [{port = 443}]
139+
140+
Module: module.storage
141+
UPDATE aws_ecs_service: api-service
142+
DELETE aws_iam_role: legacy-role
143+
CREATE aws_lambda_function: processor-function
144+
```
103145

104146
## Requirements
105147

106-
- Python 3.7 or higher
107-
- Terraform 0.12 or higher (for plan generation)
148+
- Python 3.10 or higher
149+
- Terraform 1.0 or higher (for plan generation)
108150

109151
## Contributing
110152

111-
Contributions are welcome! Please feel free to submit a Pull Request.
153+
Contributions are welcome! Please feel free to submit a Pull Request. Visit our [GitHub repository](https://github.com/rafaelherik/tfsumpy) for more information.
112154

113155
## License
114156

setup.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
description='A Python tool for Terraform state summary and analysis',
77
long_description=open('README.md').read(),
88
long_description_content_type='text/markdown',
9-
author='Notry',
10-
author_email='[email protected]',
11-
url='https://github.com/notry-cloud/tfsumpy',
9+
author='Rafael H de Carvalho',
10+
author_email='[email protected]',
11+
url='https://github.com/rafaelherik/tfsumpy',
1212
packages=find_packages(),
1313
project_urls={
14-
'Bug Tracker': 'https://github.com/notry-cloud/tfsumpy/issues',
15-
'Source Code': 'https://github.com/notry-cloud/tfsumpy',
16-
"GitHub": "https://github.com/notry-cloud/tfsumpy",
14+
'Bug Tracker': 'https://github.com/rafaelherik/tfsumpy/issues',
15+
'Source Code': 'https://github.com/rafaelherik/tfsumpy',
16+
"GitHub": "https://github.com/rafaelherik/tfsumpy",
1717
},
1818
package_data={
1919
'tfsumpy': ['rules_config.json'],

0 commit comments

Comments
 (0)