terraformgraph 1.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- terraformgraph/__init__.py +19 -0
- terraformgraph/__main__.py +6 -0
- terraformgraph/aggregator.py +396 -0
- terraformgraph/config/aggregation_rules.yaml +132 -0
- terraformgraph/config/logical_connections.yaml +183 -0
- terraformgraph/config_loader.py +55 -0
- terraformgraph/icons.py +795 -0
- terraformgraph/layout.py +239 -0
- terraformgraph/main.py +194 -0
- terraformgraph/parser.py +341 -0
- terraformgraph/renderer.py +1134 -0
- terraformgraph-1.0.1.dist-info/METADATA +161 -0
- terraformgraph-1.0.1.dist-info/RECORD +17 -0
- terraformgraph-1.0.1.dist-info/WHEEL +5 -0
- terraformgraph-1.0.1.dist-info/entry_points.txt +2 -0
- terraformgraph-1.0.1.dist-info/licenses/LICENSE +21 -0
- terraformgraph-1.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: terraformgraph
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: Generate interactive architecture diagrams from Terraform configurations
|
|
5
|
+
Author-email: Your Name <your.email@example.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/ferdinandobons/terraformgraph
|
|
8
|
+
Project-URL: Documentation, https://github.com/ferdinandobons/terraformgraph#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/ferdinandobons/terraformgraph.git
|
|
10
|
+
Project-URL: Issues, https://github.com/ferdinandobons/terraformgraph/issues
|
|
11
|
+
Keywords: terraform,infrastructure,diagram,aws,visualization,architecture,terraformgraph
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: System Administrators
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
24
|
+
Classifier: Topic :: System :: Systems Administration
|
|
25
|
+
Requires-Python: >=3.9
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: python-hcl2>=4.3.0
|
|
29
|
+
Requires-Dist: PyYAML>=6.0
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
32
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
33
|
+
Requires-Dist: black>=23.0; extra == "dev"
|
|
34
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
35
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
36
|
+
Requires-Dist: types-PyYAML>=6.0; extra == "dev"
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
|
|
39
|
+
# terraformgraph
|
|
40
|
+
|
|
41
|
+
Generate interactive architecture diagrams from your Terraform configurations. Supports AWS resources with automatic service grouping, relationship detection, and beautiful SVG/HTML output.
|
|
42
|
+
|
|
43
|
+

|
|
44
|
+
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
- **Automatic parsing** of Terraform HCL files
|
|
48
|
+
- **Smart resource grouping** into logical services (ECS, RDS, S3, etc.)
|
|
49
|
+
- **Relationship detection** based on resource references
|
|
50
|
+
- **Interactive HTML output** with drag-and-drop positioning
|
|
51
|
+
- **PNG/JPG export** directly from the browser
|
|
52
|
+
- **Customizable** via YAML configuration files
|
|
53
|
+
- **No cloud credentials required** - works entirely offline
|
|
54
|
+
|
|
55
|
+
## Installation
|
|
56
|
+
|
|
57
|
+
### From PyPI
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install terraformgraph
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### From Source
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
git clone https://github.com/ferdinandobons/terraformgraph.git
|
|
67
|
+
cd terraformgraph
|
|
68
|
+
pip install -e .
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Quick Start
|
|
72
|
+
|
|
73
|
+
### Basic Usage
|
|
74
|
+
|
|
75
|
+
Generate a diagram from a Terraform directory:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
terraformgraph -t ./infrastructure -o diagram.html
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### With Environment Subdirectories
|
|
82
|
+
|
|
83
|
+
If your Terraform is organized by environment:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
terraformgraph -t ./infrastructure -e prod -o prod-diagram.html
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### With AWS Icons
|
|
90
|
+
|
|
91
|
+
For beautiful AWS service icons, download the [AWS Architecture Icons](https://aws.amazon.com/architecture/icons/) and extract them:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
terraformgraph -t ./infrastructure -i ./AWS_Icons -o diagram.html
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Command Line Options
|
|
98
|
+
|
|
99
|
+
| Option | Required | Description |
|
|
100
|
+
|--------|----------|-------------|
|
|
101
|
+
| `-t, --terraform` | Yes | Path to Terraform directory |
|
|
102
|
+
| `-e, --environment` | No | Environment subdirectory (dev, staging, prod) |
|
|
103
|
+
| `-i, --icons` | No | Path to AWS icons directory |
|
|
104
|
+
| `-o, --output` | Yes | Output HTML file path |
|
|
105
|
+
| `-v, --verbose` | No | Enable debug output |
|
|
106
|
+
|
|
107
|
+
## Configuration
|
|
108
|
+
|
|
109
|
+
### Custom Aggregation Rules
|
|
110
|
+
|
|
111
|
+
Create `~/.terraformgraph/aggregation_rules.yaml` to customize how resources are grouped:
|
|
112
|
+
|
|
113
|
+
```yaml
|
|
114
|
+
compute:
|
|
115
|
+
my_custom_service:
|
|
116
|
+
primary: ["aws_my_resource"]
|
|
117
|
+
secondary: ["aws_my_helper"]
|
|
118
|
+
in_vpc: true
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Custom Connections
|
|
122
|
+
|
|
123
|
+
Create `~/.terraformgraph/logical_connections.yaml` to define service relationships:
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
connections:
|
|
127
|
+
- source: my_service
|
|
128
|
+
target: another_service
|
|
129
|
+
label: "Custom Connection"
|
|
130
|
+
type: data_flow
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Supported Resources
|
|
134
|
+
|
|
135
|
+
The tool supports 100+ AWS resource types including:
|
|
136
|
+
|
|
137
|
+
- **Compute**: ECS, EC2, Lambda, Auto Scaling
|
|
138
|
+
- **Networking**: VPC, ALB/NLB, Route53, CloudFront
|
|
139
|
+
- **Storage**: S3, EBS, EFS
|
|
140
|
+
- **Database**: RDS, DynamoDB, ElastiCache
|
|
141
|
+
- **Messaging**: SQS, SNS, EventBridge
|
|
142
|
+
- **Security**: IAM, KMS, Secrets Manager, WAF
|
|
143
|
+
- **And many more...**
|
|
144
|
+
|
|
145
|
+
## Output
|
|
146
|
+
|
|
147
|
+
The generated HTML file includes:
|
|
148
|
+
|
|
149
|
+
- **Interactive diagram** with pan and zoom
|
|
150
|
+
- **Drag-and-drop** to reposition services
|
|
151
|
+
- **Click connections** to highlight data flows
|
|
152
|
+
- **Export buttons** for PNG and JPG
|
|
153
|
+
- **Save/Load layout** using browser storage
|
|
154
|
+
|
|
155
|
+
## Contributing
|
|
156
|
+
|
|
157
|
+
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
158
|
+
|
|
159
|
+
## License
|
|
160
|
+
|
|
161
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
terraformgraph/__init__.py,sha256=NeUERqcQFeEDBB3zRE5b-y1MtTz85WrtpmO5nVBOgk4,469
|
|
2
|
+
terraformgraph/__main__.py,sha256=E1MUfKa9LQ2_zosMoerGFHMXqWzLc9D9WO2ZUyMyN5Y,134
|
|
3
|
+
terraformgraph/aggregator.py,sha256=fWTZbiwac8CEGJeQlN3X3FNAmHh5mPBsx-3dTnzaLVc,14238
|
|
4
|
+
terraformgraph/config_loader.py,sha256=D5EIRqFX6Gz1BNu2b2pbG_YWqcTrUKE2iebyR58FMMo,2195
|
|
5
|
+
terraformgraph/icons.py,sha256=5moYr_u4yP-Miyt0GVULavjJueZGdTwUh0W9qNJszSo,42396
|
|
6
|
+
terraformgraph/layout.py,sha256=xqua1i-y3PQ_10-ZHMM43vpob87dJHbvKvs48gFp8Iw,8219
|
|
7
|
+
terraformgraph/main.py,sha256=FA4npH6hSJRQun_y-A9by39WxOIcRX69zdkRWsJRVec,6576
|
|
8
|
+
terraformgraph/parser.py,sha256=BDRTbQIMrTr-B_I4F17udT3hskAhN3jE5uajpp_OdZU,12525
|
|
9
|
+
terraformgraph/renderer.py,sha256=mAen2OxvuH7it8pAWbO6aMS75WuW8VMSUwxufxpyJ4g,42233
|
|
10
|
+
terraformgraph/config/aggregation_rules.yaml,sha256=BDkT37jCAQ0fKYqGmDJcuo6XjvfS1up5Yk1DXE4aP8M,4340
|
|
11
|
+
terraformgraph/config/logical_connections.yaml,sha256=ECOByIfuC5PStsukEkulEB8ixe4F28Q5Ak7xCs0yogA,2901
|
|
12
|
+
terraformgraph-1.0.1.dist-info/licenses/LICENSE,sha256=14dWZLNvm9xaUFeRin_gDB_iynn6m604g5GsutxqYsM,1068
|
|
13
|
+
terraformgraph-1.0.1.dist-info/METADATA,sha256=fZwChDSsNcUp7laN-XmXnQLoOEF4F1RDr5zMNP1HZqg,4767
|
|
14
|
+
terraformgraph-1.0.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
15
|
+
terraformgraph-1.0.1.dist-info/entry_points.txt,sha256=dONSqeGLyLFZCNcNjJiyLXDa23j-iwAq3u6Qtv6RI0w,60
|
|
16
|
+
terraformgraph-1.0.1.dist-info/top_level.txt,sha256=iquGz8nmBrUGI8SQKJcYrq8ea7UHnBMEXRel0QuNJkI,15
|
|
17
|
+
terraformgraph-1.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 [Your Name]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
terraformgraph
|