terraformgraph 1.0.2__py3-none-any.whl → 1.0.4__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 +1 -1
- terraformgraph/__main__.py +1 -1
- terraformgraph/aggregator.py +941 -300
- terraformgraph/config/aggregation_rules.yaml +276 -1
- terraformgraph/config_loader.py +9 -8
- terraformgraph/icons.py +504 -521
- terraformgraph/layout.py +580 -116
- terraformgraph/main.py +251 -48
- terraformgraph/parser.py +328 -86
- terraformgraph/renderer.py +1887 -170
- terraformgraph/terraform_tools.py +355 -0
- terraformgraph/variable_resolver.py +180 -0
- terraformgraph-1.0.4.dist-info/METADATA +386 -0
- terraformgraph-1.0.4.dist-info/RECORD +19 -0
- {terraformgraph-1.0.2.dist-info → terraformgraph-1.0.4.dist-info}/licenses/LICENSE +1 -1
- terraformgraph-1.0.2.dist-info/METADATA +0 -163
- terraformgraph-1.0.2.dist-info/RECORD +0 -17
- {terraformgraph-1.0.2.dist-info → terraformgraph-1.0.4.dist-info}/WHEEL +0 -0
- {terraformgraph-1.0.2.dist-info → terraformgraph-1.0.4.dist-info}/entry_points.txt +0 -0
- {terraformgraph-1.0.2.dist-info → terraformgraph-1.0.4.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: terraformgraph
|
|
3
|
+
Version: 1.0.4
|
|
4
|
+
Summary: Generate interactive architecture diagrams from Terraform configurations
|
|
5
|
+
Author-email: Ferdinando Bonsegna <1bonsegnaferdinando@gmail.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 with state integration
|
|
48
|
+
- **Smart resource grouping** into logical services (ECS, RDS, S3, etc.)
|
|
49
|
+
- **Relationship detection** based on resource references
|
|
50
|
+
- **VPC structure visualization** with subnets and availability zones
|
|
51
|
+
- **VPC endpoint visualization** with service-specific icons (S3, DynamoDB, ECR, etc.)
|
|
52
|
+
- **Accurate resource positioning** using Terraform state
|
|
53
|
+
- **Interactive HTML output** with:
|
|
54
|
+
- Drag-and-drop repositioning of service icons
|
|
55
|
+
- Click-to-highlight connections between services
|
|
56
|
+
- Click-to-highlight source and target endpoints
|
|
57
|
+
- Save/Load layout persistence
|
|
58
|
+
- Zoom and pan navigation
|
|
59
|
+
- **PNG/JPG export** directly from the browser
|
|
60
|
+
- **Customizable** via YAML configuration files
|
|
61
|
+
- **No cloud credentials required** - works entirely offline
|
|
62
|
+
|
|
63
|
+
## Prerequisites
|
|
64
|
+
|
|
65
|
+
### Required
|
|
66
|
+
|
|
67
|
+
- **Python 3.9+** (3.9, 3.10, 3.11, or 3.12)
|
|
68
|
+
- **pip** (Python package manager)
|
|
69
|
+
- **Terraform CLI** - Required for generating state JSON
|
|
70
|
+
|
|
71
|
+
### Optional
|
|
72
|
+
|
|
73
|
+
- **AWS Architecture Icons** - For beautiful service icons (see [With AWS Icons](#with-aws-icons))
|
|
74
|
+
|
|
75
|
+
### Terraform Setup
|
|
76
|
+
|
|
77
|
+
Before using terraformgraph, initialize and apply your Terraform configuration:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
cd ./infrastructure
|
|
81
|
+
terraform init
|
|
82
|
+
terraform apply # or terraform plan for undeployed infrastructure
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
This creates the state data that terraformgraph uses for accurate diagram generation.
|
|
86
|
+
|
|
87
|
+
## Installation
|
|
88
|
+
|
|
89
|
+
### From PyPI
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
pip install terraformgraph
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### From Source
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
git clone https://github.com/ferdinandobons/terraformgraph.git
|
|
99
|
+
cd terraformgraph
|
|
100
|
+
pip install -e .
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Development Installation
|
|
104
|
+
|
|
105
|
+
For contributing or running tests:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
git clone https://github.com/ferdinandobons/terraformgraph.git
|
|
109
|
+
cd terraformgraph
|
|
110
|
+
pip install -e ".[dev]"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
This installs additional development dependencies:
|
|
114
|
+
- `pytest` - Testing framework
|
|
115
|
+
- `pytest-cov` - Code coverage
|
|
116
|
+
- `black` - Code formatting
|
|
117
|
+
- `ruff` - Linting
|
|
118
|
+
- `mypy` - Type checking
|
|
119
|
+
|
|
120
|
+
## Quick Start
|
|
121
|
+
|
|
122
|
+
### Basic Usage
|
|
123
|
+
|
|
124
|
+
Generate a diagram from a Terraform directory:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
terraformgraph -t ./infrastructure
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
This creates `terraformgraph.html` in the current directory.
|
|
131
|
+
|
|
132
|
+
**Note:** The tool automatically generates state JSON from `terraform show -json` if no cached state exists. Make sure your Terraform is initialized (`terraform init`) before running.
|
|
133
|
+
|
|
134
|
+
### With Environment Subdirectories
|
|
135
|
+
|
|
136
|
+
If your Terraform is organized by environment:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
terraformgraph -t ./infrastructure -e prod -o prod-diagram.html
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### With Pre-generated State File
|
|
143
|
+
|
|
144
|
+
If you want to generate the state file manually (useful for CI/CD):
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Generate state JSON
|
|
148
|
+
cd ./infrastructure
|
|
149
|
+
terraform show -json > state.json
|
|
150
|
+
|
|
151
|
+
# Use it with terraformgraph
|
|
152
|
+
terraformgraph -t ./infrastructure --state-file state.json
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Force State Refresh
|
|
156
|
+
|
|
157
|
+
To regenerate the cached state file:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
terraformgraph -t ./infrastructure --refresh-state
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### With AWS Icons
|
|
164
|
+
|
|
165
|
+
For beautiful AWS service icons, download the [AWS Architecture Icons](https://aws.amazon.com/architecture/icons/) and extract them:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
terraformgraph -t ./infrastructure -i ./AWS_Icons
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The tool also auto-discovers icons in these locations:
|
|
172
|
+
- `./aws-official-icons`
|
|
173
|
+
- `~/aws-official-icons`
|
|
174
|
+
- `~/.terraformgraph/icons`
|
|
175
|
+
|
|
176
|
+
## Command Line Options
|
|
177
|
+
|
|
178
|
+
| Option | Short | Required | Description |
|
|
179
|
+
|--------|-------|----------|-------------|
|
|
180
|
+
| `--terraform` | `-t` | Yes | Path to Terraform directory |
|
|
181
|
+
| `--environment` | `-e` | No | Environment subdirectory (dev, staging, prod) |
|
|
182
|
+
| `--icons` | `-i` | No | Path to AWS icons directory |
|
|
183
|
+
| `--output` | `-o` | No | Output HTML file path (default: `terraformgraph.html`) |
|
|
184
|
+
| `--verbose` | `-v` | No | Enable debug output |
|
|
185
|
+
| `--state-file` | `-s` | No | Path to pre-generated state JSON file |
|
|
186
|
+
| `--refresh-state` | | No | Force regeneration of cached state file |
|
|
187
|
+
|
|
188
|
+
### Examples
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# Basic usage (auto-generates state)
|
|
192
|
+
terraformgraph -t ./infrastructure
|
|
193
|
+
|
|
194
|
+
# With environment
|
|
195
|
+
terraformgraph -t ./infrastructure -e prod
|
|
196
|
+
|
|
197
|
+
# With custom output
|
|
198
|
+
terraformgraph -t ./infrastructure -o my-diagram.html
|
|
199
|
+
|
|
200
|
+
# With AWS icons
|
|
201
|
+
terraformgraph -t ./infrastructure -i ~/Downloads/AWS_Icons
|
|
202
|
+
|
|
203
|
+
# With pre-generated state file
|
|
204
|
+
terraformgraph -t ./infrastructure -s state.json
|
|
205
|
+
|
|
206
|
+
# Force state refresh
|
|
207
|
+
terraformgraph -t ./infrastructure --refresh-state
|
|
208
|
+
|
|
209
|
+
# Full options with verbose output
|
|
210
|
+
terraformgraph -t ./infrastructure -e prod -i ./icons -o prod.html -v
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## How It Works
|
|
214
|
+
|
|
215
|
+
1. **State Acquisition**: terraformgraph reads Terraform state (from cached file, provided file, or auto-generated via `terraform show -json`)
|
|
216
|
+
2. **HCL Parsing**: Parses `.tf` files to understand resource structure and relationships
|
|
217
|
+
3. **Resource Aggregation**: Groups resources into logical services (e.g., all ECS-related resources into an "ECS" service)
|
|
218
|
+
4. **VPC Structure**: Builds VPC topology with availability zones, subnets, and endpoints
|
|
219
|
+
5. **Layout Computation**: Calculates optimal positions for services in the diagram
|
|
220
|
+
6. **HTML Generation**: Creates interactive SVG diagram with pan, zoom, and drag capabilities
|
|
221
|
+
|
|
222
|
+
## Configuration
|
|
223
|
+
|
|
224
|
+
### Custom Aggregation Rules
|
|
225
|
+
|
|
226
|
+
Create `~/.terraformgraph/aggregation_rules.yaml` to customize how resources are grouped:
|
|
227
|
+
|
|
228
|
+
```yaml
|
|
229
|
+
compute:
|
|
230
|
+
my_custom_service:
|
|
231
|
+
primary: ["aws_my_resource"]
|
|
232
|
+
secondary: ["aws_my_helper"]
|
|
233
|
+
in_vpc: true
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Custom Connections
|
|
237
|
+
|
|
238
|
+
Create `~/.terraformgraph/logical_connections.yaml` to define service relationships:
|
|
239
|
+
|
|
240
|
+
```yaml
|
|
241
|
+
connections:
|
|
242
|
+
- source: my_service
|
|
243
|
+
target: another_service
|
|
244
|
+
label: "Custom Connection"
|
|
245
|
+
type: data_flow
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## Supported Resources
|
|
249
|
+
|
|
250
|
+
The tool supports 100+ AWS resource types including:
|
|
251
|
+
|
|
252
|
+
### Compute
|
|
253
|
+
- ECS (Clusters, Services, Task Definitions)
|
|
254
|
+
- EC2 (Instances, Auto Scaling Groups, Launch Templates)
|
|
255
|
+
- Lambda (Functions, Layers, Event Source Mappings)
|
|
256
|
+
- EKS (Clusters, Node Groups)
|
|
257
|
+
- Batch (Compute Environments, Job Queues)
|
|
258
|
+
|
|
259
|
+
### Networking
|
|
260
|
+
- VPC (VPCs, Subnets, Route Tables, Internet Gateways)
|
|
261
|
+
- VPC Endpoints (Gateway and Interface types)
|
|
262
|
+
- Load Balancers (ALB, NLB, Target Groups)
|
|
263
|
+
- Route53 (Zones, Records)
|
|
264
|
+
- CloudFront (Distributions)
|
|
265
|
+
- API Gateway (REST and HTTP APIs)
|
|
266
|
+
|
|
267
|
+
### Storage
|
|
268
|
+
- S3 (Buckets, Bucket Policies)
|
|
269
|
+
- EBS (Volumes, Snapshots)
|
|
270
|
+
- EFS (File Systems, Mount Targets)
|
|
271
|
+
|
|
272
|
+
### Database
|
|
273
|
+
- RDS (Instances, Clusters, Parameter Groups)
|
|
274
|
+
- DynamoDB (Tables, Global Tables)
|
|
275
|
+
- ElastiCache (Clusters, Replication Groups)
|
|
276
|
+
- DocumentDB, Neptune, Redshift
|
|
277
|
+
|
|
278
|
+
### Messaging & Integration
|
|
279
|
+
- SQS (Queues)
|
|
280
|
+
- SNS (Topics, Subscriptions)
|
|
281
|
+
- EventBridge (Rules, Event Buses)
|
|
282
|
+
- Step Functions (State Machines)
|
|
283
|
+
- Kinesis (Streams, Firehose)
|
|
284
|
+
|
|
285
|
+
### Security
|
|
286
|
+
- IAM (Roles, Policies, Users, Groups)
|
|
287
|
+
- KMS (Keys, Aliases)
|
|
288
|
+
- Secrets Manager (Secrets)
|
|
289
|
+
- WAF (Web ACLs, Rules)
|
|
290
|
+
- Security Groups
|
|
291
|
+
|
|
292
|
+
### Monitoring & Management
|
|
293
|
+
- CloudWatch (Alarms, Log Groups, Dashboards)
|
|
294
|
+
- CloudTrail
|
|
295
|
+
- Config Rules
|
|
296
|
+
|
|
297
|
+
### And many more...
|
|
298
|
+
|
|
299
|
+
See the full list in the [aggregation_rules.yaml](terraformgraph/config/aggregation_rules.yaml) configuration file.
|
|
300
|
+
|
|
301
|
+
## Output
|
|
302
|
+
|
|
303
|
+
The generated HTML file includes:
|
|
304
|
+
|
|
305
|
+
### Interactive Features
|
|
306
|
+
- **Pan and Zoom** - Navigate large diagrams easily
|
|
307
|
+
- **Drag-and-drop** - Reposition service icons within their containers
|
|
308
|
+
- **Click connections** - Click any connection line to highlight the data flow
|
|
309
|
+
- **Click services** - Click any service to see all its connections highlighted
|
|
310
|
+
- **Save layout** - Persist your custom icon positions to browser storage
|
|
311
|
+
- **Load layout** - Restore previously saved positions
|
|
312
|
+
|
|
313
|
+
### Export Options
|
|
314
|
+
- **PNG Export** - High-quality raster image
|
|
315
|
+
- **JPG Export** - Compressed raster image
|
|
316
|
+
|
|
317
|
+
### Visual Elements
|
|
318
|
+
- **VPC containers** with subnet boundaries
|
|
319
|
+
- **Availability zone indicators**
|
|
320
|
+
- **Service icons** (with AWS icons or colored fallbacks)
|
|
321
|
+
- **Connection lines** showing relationships
|
|
322
|
+
- **Resource counts** for grouped resources
|
|
323
|
+
- **Legend** with interaction instructions
|
|
324
|
+
|
|
325
|
+
## Project Structure
|
|
326
|
+
|
|
327
|
+
```
|
|
328
|
+
terraformgraph/
|
|
329
|
+
├── terraformgraph/
|
|
330
|
+
│ ├── __init__.py # Package init with version
|
|
331
|
+
│ ├── __main__.py # Entry point for python -m
|
|
332
|
+
│ ├── main.py # CLI entry point
|
|
333
|
+
│ ├── parser.py # Terraform HCL parser
|
|
334
|
+
│ ├── aggregator.py # Resource grouping logic
|
|
335
|
+
│ ├── layout.py # Diagram layout engine
|
|
336
|
+
│ ├── renderer.py # SVG/HTML renderer
|
|
337
|
+
│ ├── icons.py # AWS icon mapper
|
|
338
|
+
│ ├── terraform_tools.py # Terraform CLI integration
|
|
339
|
+
│ ├── variable_resolver.py # Variable resolution
|
|
340
|
+
│ └── config/ # Default configuration files
|
|
341
|
+
├── tests/ # Test suite
|
|
342
|
+
├── example/ # Example Terraform configs
|
|
343
|
+
└── docs/ # Documentation
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
## Running Tests
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
# Run all tests
|
|
350
|
+
pytest
|
|
351
|
+
|
|
352
|
+
# Run with coverage
|
|
353
|
+
pytest --cov=terraformgraph
|
|
354
|
+
|
|
355
|
+
# Run specific test file
|
|
356
|
+
pytest tests/test_parser.py
|
|
357
|
+
|
|
358
|
+
# Run with verbose output
|
|
359
|
+
pytest -v
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
## Contributing
|
|
363
|
+
|
|
364
|
+
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
365
|
+
|
|
366
|
+
### Development Workflow
|
|
367
|
+
|
|
368
|
+
1. Fork the repository
|
|
369
|
+
2. Create a feature branch
|
|
370
|
+
3. Make your changes
|
|
371
|
+
4. Run tests: `pytest`
|
|
372
|
+
5. Format code: `black terraformgraph/`
|
|
373
|
+
6. Lint code: `ruff check terraformgraph/`
|
|
374
|
+
7. Submit a pull request
|
|
375
|
+
|
|
376
|
+
## Changelog
|
|
377
|
+
|
|
378
|
+
See [CHANGELOG.md](CHANGELOG.md) for version history and changes.
|
|
379
|
+
|
|
380
|
+
## License
|
|
381
|
+
|
|
382
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
383
|
+
|
|
384
|
+
## Author
|
|
385
|
+
|
|
386
|
+
Ferdinando Bonsegna - [GitHub](https://github.com/ferdinandobons)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
terraformgraph/__init__.py,sha256=P8TG3q97jSeON2wd2ZDuvPGfnU3X-hQOcpVTASlENWo,469
|
|
2
|
+
terraformgraph/__main__.py,sha256=DnOv8Y0Hro-Ryc2ey3u7oLmZ2Qm_IFF5l0RNdOCLsZ0,134
|
|
3
|
+
terraformgraph/aggregator.py,sha256=uV5syYVYDiy1LqtWO82yLd4LefDLB1hKsfhFtLDfoNk,40305
|
|
4
|
+
terraformgraph/config_loader.py,sha256=Ue_v9MnxhlH6Ksv21QWNxSAluZ2quUgHJon173qsYdk,2204
|
|
5
|
+
terraformgraph/icons.py,sha256=yn52QFB1DVvWddx0ka-Qi2NoFeMu6zdHBeQfM1wh5rQ,42315
|
|
6
|
+
terraformgraph/layout.py,sha256=YBwYuL5Jxe-DCxNWQ_KANzJqPiv4v-CSAxhNb3CdfCY,27794
|
|
7
|
+
terraformgraph/main.py,sha256=0NnKC4Sk3winqr-JAlTLfIM-_nmC2Nw_xzDXf0q-kEY,13462
|
|
8
|
+
terraformgraph/parser.py,sha256=--ote0fkbEHgCQ2phBCbGTDdTtyH0eMGLpJeifJpxjM,23060
|
|
9
|
+
terraformgraph/renderer.py,sha256=7AGb-2OGBfY2y0cKc1tgMutQFfwxnIGLv6EnTkZyje0,120850
|
|
10
|
+
terraformgraph/terraform_tools.py,sha256=9hDsbMgC4imf13HMN07ADQi1c1uDPXr8bGAEDwmtFOU,12414
|
|
11
|
+
terraformgraph/variable_resolver.py,sha256=vX6issc19xOB50pzeeUw-3CuzY-WYrxwg1aGw2810i8,6554
|
|
12
|
+
terraformgraph/config/aggregation_rules.yaml,sha256=yqBOOHypPjww8XZr2KerJ5EQSBeHBr4twifPCBp6nXc,12555
|
|
13
|
+
terraformgraph/config/logical_connections.yaml,sha256=ECOByIfuC5PStsukEkulEB8ixe4F28Q5Ak7xCs0yogA,2901
|
|
14
|
+
terraformgraph-1.0.4.dist-info/licenses/LICENSE,sha256=Xy2eAxwuRwpfv90g0I3XCE_siODHZk4JSPlXZcbqQJk,1076
|
|
15
|
+
terraformgraph-1.0.4.dist-info/METADATA,sha256=CskLXULXC8wD2_Tkf_Lk7Ns8eB3o75PNdY7VC9viWNU,11511
|
|
16
|
+
terraformgraph-1.0.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
17
|
+
terraformgraph-1.0.4.dist-info/entry_points.txt,sha256=dONSqeGLyLFZCNcNjJiyLXDa23j-iwAq3u6Qtv6RI0w,60
|
|
18
|
+
terraformgraph-1.0.4.dist-info/top_level.txt,sha256=iquGz8nmBrUGI8SQKJcYrq8ea7UHnBMEXRel0QuNJkI,15
|
|
19
|
+
terraformgraph-1.0.4.dist-info/RECORD,,
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: terraformgraph
|
|
3
|
-
Version: 1.0.2
|
|
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
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
This creates `diagram.html` in the current directory.
|
|
82
|
-
|
|
83
|
-
### With Environment Subdirectories
|
|
84
|
-
|
|
85
|
-
If your Terraform is organized by environment:
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
terraformgraph -t ./infrastructure -e prod -o prod-diagram.html
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### With AWS Icons
|
|
92
|
-
|
|
93
|
-
For beautiful AWS service icons, download the [AWS Architecture Icons](https://aws.amazon.com/architecture/icons/) and extract them:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
terraformgraph -t ./infrastructure -i ./AWS_Icons
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
## Command Line Options
|
|
100
|
-
|
|
101
|
-
| Option | Required | Description |
|
|
102
|
-
|--------|----------|-------------|
|
|
103
|
-
| `-t, --terraform` | Yes | Path to Terraform directory |
|
|
104
|
-
| `-e, --environment` | No | Environment subdirectory (dev, staging, prod) |
|
|
105
|
-
| `-i, --icons` | No | Path to AWS icons directory |
|
|
106
|
-
| `-o, --output` | No | Output HTML file path (default: `diagram.html`) |
|
|
107
|
-
| `-v, --verbose` | No | Enable debug output |
|
|
108
|
-
|
|
109
|
-
## Configuration
|
|
110
|
-
|
|
111
|
-
### Custom Aggregation Rules
|
|
112
|
-
|
|
113
|
-
Create `~/.terraformgraph/aggregation_rules.yaml` to customize how resources are grouped:
|
|
114
|
-
|
|
115
|
-
```yaml
|
|
116
|
-
compute:
|
|
117
|
-
my_custom_service:
|
|
118
|
-
primary: ["aws_my_resource"]
|
|
119
|
-
secondary: ["aws_my_helper"]
|
|
120
|
-
in_vpc: true
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### Custom Connections
|
|
124
|
-
|
|
125
|
-
Create `~/.terraformgraph/logical_connections.yaml` to define service relationships:
|
|
126
|
-
|
|
127
|
-
```yaml
|
|
128
|
-
connections:
|
|
129
|
-
- source: my_service
|
|
130
|
-
target: another_service
|
|
131
|
-
label: "Custom Connection"
|
|
132
|
-
type: data_flow
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
## Supported Resources
|
|
136
|
-
|
|
137
|
-
The tool supports 100+ AWS resource types including:
|
|
138
|
-
|
|
139
|
-
- **Compute**: ECS, EC2, Lambda, Auto Scaling
|
|
140
|
-
- **Networking**: VPC, ALB/NLB, Route53, CloudFront
|
|
141
|
-
- **Storage**: S3, EBS, EFS
|
|
142
|
-
- **Database**: RDS, DynamoDB, ElastiCache
|
|
143
|
-
- **Messaging**: SQS, SNS, EventBridge
|
|
144
|
-
- **Security**: IAM, KMS, Secrets Manager, WAF
|
|
145
|
-
- **And many more...**
|
|
146
|
-
|
|
147
|
-
## Output
|
|
148
|
-
|
|
149
|
-
The generated HTML file includes:
|
|
150
|
-
|
|
151
|
-
- **Interactive diagram** with pan and zoom
|
|
152
|
-
- **Drag-and-drop** to reposition services
|
|
153
|
-
- **Click connections** to highlight data flows
|
|
154
|
-
- **Export buttons** for PNG and JPG
|
|
155
|
-
- **Save/Load layout** using browser storage
|
|
156
|
-
|
|
157
|
-
## Contributing
|
|
158
|
-
|
|
159
|
-
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
160
|
-
|
|
161
|
-
## License
|
|
162
|
-
|
|
163
|
-
MIT License - see [LICENSE](LICENSE) for details.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
terraformgraph/__init__.py,sha256=fnxp13XW7PX9_BGYUGceV13yE__mbRTYmGqdS-UuxqE,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=jekIKiWLbRjYGXIUaTdxnD6nInpLoX7xoHaqyqrOPPM,6668
|
|
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.2.dist-info/licenses/LICENSE,sha256=14dWZLNvm9xaUFeRin_gDB_iynn6m604g5GsutxqYsM,1068
|
|
13
|
-
terraformgraph-1.0.2.dist-info/METADATA,sha256=moAQ8GUvfQ6aywg-N9FgAF5pz9FkMctkYD41Su2LZyI,4815
|
|
14
|
-
terraformgraph-1.0.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
15
|
-
terraformgraph-1.0.2.dist-info/entry_points.txt,sha256=dONSqeGLyLFZCNcNjJiyLXDa23j-iwAq3u6Qtv6RI0w,60
|
|
16
|
-
terraformgraph-1.0.2.dist-info/top_level.txt,sha256=iquGz8nmBrUGI8SQKJcYrq8ea7UHnBMEXRel0QuNJkI,15
|
|
17
|
-
terraformgraph-1.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|