Sufficient visibility into cloud infrastructure failures โ live AWS topology + Terraform drift in one CLI.
Project description
๐ฌ sudiviz
X-ray vision for your cloud infrastructure
sudiviz visualizes your live cloud infrastructure as an interactive graph โ terminal, web, or PNG. It auto-detects misconfigurations, unhealthy targets, and orphan resources, then generates one-click fixes. ๐ Zero AI tokens. ๐ธ Zero operational cost. ๐ Pure Python.
_ _ _
___ _ _ __| (_)_ _(_)____
/ __| | | |/ _` | \ \ / / |_ /
\__ \ |_| | (_| | |\ V /| |/ /
|___/\__,_|\__,_|_| \_/ |_/___|
X-ray vision for your cloud infrastructure
๐ธ Screenshots
๐ Web Visualization
Interactive graph with live updates, node inspection, orphan detection (red dashed), and one-click AWS Console access.
๐ฅ๏ธ Terminal TUI
Full-featured terminal UI with keyboard navigation, health status, and orphan highlighting.
๐ป Diagnose
Instant topology view + diagnosis table showing issues by severity.
๐ง Auto-Fix (Preview)
See exactly what will be fixed before applying โ with AWS CLI commands included.
โก Auto-Fix (Apply)
One command to fix issues. Destructive operations require --force.
๐ค Why sudiviz?
Hava.io and Cloudcraft.co generate gorgeous diagrams โ but they're snapshots. By the time you reload, your problem has moved. sudiviz is built around live data: every render is a fresh API call, every node is clickable, every orphan is highlighted in red dashed lines.
| Feature | sudiviz | Hava.io | Cloudcraft |
|---|---|---|---|
| Live data (no manual refresh) | โ | โ (static) | โ (static) |
| Terminal UI (Textual) | โ | โ | โ |
| Interactive web (Cytoscape.js) | โ | โ | โ |
| WebSocket real-time updates | โ | โ | โ |
| PNG export | โ | โ | โ |
| Plain-English fix suggestions | โ | โ | โ |
| Terraform drift detection | โ | โ | โ |
| Orphan detection (red dashed) | โ | โ | โ |
| ECS / EKS / RDS / Lambda / S3 | โ | โ | โ |
| Security & encryption checks | โ | โ | โ |
| Free / open source | โ MIT | โ ($29/mo) | โ ($49/mo) |
CI-friendly --json flag |
โ | โ | โ |
๐ฆ Install
pip install sudiviz # core CLI (EC2, ALB, SGs, basic discovery)
pip install 'sudiviz[all]' # + TUI, web server, PNG diagrams
Auth: sudiviz uses the standard boto3 credential chain โ env vars,
~/.aws/credentials, SSO, instance profile. Credentials are never accepted as CLI flags. Runaws configureor setAWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_DEFAULT_REGIONbefore running.
โ๏ธ AWS services discovered
sudiviz discovers these services in parallel from your live AWS account:
| Service | What's collected |
|---|---|
| ALB / NLB | Load balancers, listeners, listener rules, scheme, state |
| Target Groups | Protocol, port, per-target health (healthy / unhealthy / draining) |
| EC2 Instances | State, IPs, subnet, security group memberships |
| Security Groups | Ingress/egress rules, ENI attachments |
| ECS | Clusters โ Services (desired vs running tasks, launch type, TG links) |
| EKS | Clusters โ Node Groups (status, capacity type, scaling config) |
| RDS | DB instances (engine, status, endpoint, encryption, public access) |
| Lambda | Functions (runtime, state, VPC config, event source mappings) |
| S3 | Buckets (versioning, public access block, server-side encryption) |
| VPC | Used as the graph root when --vpc-id is supplied |
All discovery calls run via asyncio.to_thread โ a typical account with
~50 resources finishes in under 5 seconds.
๐จ Three visualization modes
1. ๐ป Terminal (default)
sudiviz diagnose --region us-east-1
sudiviz diagnose --vpc-id vpc-abc --service-tag Service=checkout
โญโ sudiviz topology โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Topology โ
โ โโโ alb: web-prod โ
โ โ โโโ โโโถ target_group: web-prod-tg [2/3] โ
โ โ โโโ โโโถ instance: i-0a1b2c (healthy) โ
โ โ โโโ โโโถ instance: i-0a1b2d (unhealthy) โ
โ โโโ ECS โ
โ โ โโโ ecs_cluster: prod-cluster โ
โ โ โโโ โโโถ ecs_service: api [3/3 running] โ
โ โโโ EKS โ
โ โ โโโ eks_cluster: prod โโโถ eks_nodegroup: workers โ
โ โโโ RDS โ
โ โ โโโ rds: mydb (postgres / available) โ
โ โโโ Lambda โ
โ โ โโโ lambda: worker (python3.12 / Active) โ
โ โโโ S3 โ
โ โ โโโ s3: my-bucket โ
โ โโโ ORPHANS โ
โ โโ target_group: legacy-tg โ
โ โโ security_group: unused-sg โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Severity โ Title โ Detail โ
โโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ critical โ S3 'my-bucket': public access open โ Enable S3 Block Public Accessโฆ โ
โ critical โ TG 'web-prod-tg': 2/3 healthy โ 1 target failing health checksโฆ โ
โ warning โ RDS 'mydb': storage not encrypted โ Enable SSE-S3 or SSE-KMSโฆ โ
โ warning โ Orphan target group: legacy-tg โ No listener forwards hereโฆ โ
โ info โ Unused security group: unused-sg โ Safe to delete. โ
โโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
2. ๐ฅ๏ธ Textual TUI (mouse + keyboard)
sudiviz tui --vpc-id vpc-abc
pip install 'sudiviz[tui]' # if not already installed
| Key | Action |
|---|---|
r |
Refresh discovery |
o |
Toggle orphan-only filter |
d |
Drift overlay hint |
q |
Quit |
Click any row to populate the details pane โ shows ARN, health, engine, task counts, encryption status, and more depending on node type.
Status bar shows live counts for all services:
โ 123456789 us-east-1 vpc=all ยท 3 ALBs ยท 5 TGs ยท 8 EC2 ยท 2 ECS clusters (6 svcs) ยท 1 EKS clusters ยท 3 RDS ยท 4 Lambda ยท 12 S3 ยท refreshed 14:23:01
3. ๐ Interactive web (Cytoscape.js)
pip install 'sudiviz[web]' # if not already installed
sudiviz graph --output web --port 8000 --open
Opens a browser with a live topology graph that:
- Pans, zooms, and drags nodes freely
- Click any node โ sidebar shows full metadata (ARN, health, engine, task counts, encryption)
- Cmd/Ctrl-click opens the AWS Console directly for that resource
- Auto-refreshes every 30 s via WebSocket (toggleable)
- Orphan edges pulse red dashed โ impossible to miss
- โ Orphans button filters the graph to only show problem nodes
- โค PNG button exports the current view as a PNG
Node colours by kind:
| Node type | Shape | Colour |
|---|---|---|
| ALB / NLB | Cut rectangle | Blue |
| Target Group | Rounded rect | Cyan |
| EC2 Instance | Rounded rect | Purple |
| Security Group | Diamond | Amber |
| ECS Cluster | Barrel | Pink |
| ECS Service | Rounded rect | Fuchsia |
| EKS Cluster | Hexagon | Blue |
| EKS Node Group | Rounded rect | Sky |
| RDS | Barrel | Yellow |
| Lambda | Triangle | Green |
| S3 | Rounded rect | Orange |
| VPC | Rectangle | Gray |
Or export a static PNG:
sudiviz graph --output png --file topology.png --open
๐ฆ Connectivity indicators โ green / red / dashed
sudiviz uses a consistent visual language across all three output modes:
| State | Terminal | Web (Cytoscape) | PNG (Graphviz) |
|---|---|---|---|
| Healthy edge | โโโถ (dim) |
Solid green line (#22c55e) |
style=solid color=#374151 |
| Orphan edge | โโโถ (bold red) |
Dashed red line (#dc2626) + pulse |
style=dashed color=#dc2626 penwidth=2 |
| Healthy node border | โ | Green border | Green fill #dcfce7 |
| Unhealthy node border | โ | Red border | Red fill #fecaca |
| Orphan node | Red dashed section | Red dashed border + red fill #fee2e2 |
Red fill #fee2e2 |
What triggers a red dashed line?
An edge turns red and dashed whenever either endpoint is an orphan:
- Orphan target group โ no ALB listener has a
forwards_toedge pointing at it. - Orphan instance โ not registered in any target group.
- Orphan security group โ no ENI or resource has a
guarded_byedge to it.
sudiviz diagnose --show-unattached --highlight-orphans
Algorithm lives in sudiviz/graph/analyzer.py โ
mark_orphaned_edges(). It annotates node['orphan']=True and
edge['style']='dashed' so all visualizers stay output-agnostic.
๐ฉบ Diagnostic rules โ what sudiviz checks
Load balancer + networking
| Check | Severity |
|---|---|
| Target group has unhealthy targets | critical / warning |
| Instance SG missing required port from ALB SG | critical |
| Orphan target group (no listener routes to it) | warning |
| Instance not in any target group | info |
| Security group attached to nothing | info |
ECS
| Check | Severity |
|---|---|
Service running < desired tasks |
critical (0 running) / warning |
| Service has 0 desired tasks | โ (skipped, intentional scale-down) |
EKS
| Check | Severity |
|---|---|
| Cluster not in ACTIVE state | critical |
| Node group not in ACTIVE state | warning |
RDS
| Check | Severity |
|---|---|
Instance not available |
critical (failed) / warning |
| Storage encryption disabled | warning |
| Publicly accessible | warning |
Lambda
| Check | Severity |
|---|---|
Function state not Active |
warning |
S3
| Check | Severity |
|---|---|
| Public access not fully blocked | critical |
| Server-side encryption not enabled | warning |
๐ Terraform drift detection
terraform show -json > tfstate.json
sudiviz drift --tfstate tfstate.json --region us-east-1
Compares your Terraform state against live AWS. Covers:
| Terraform resource type | Live check |
|---|---|
aws_lb / aws_alb |
Load balancers |
aws_lb_target_group |
Target groups |
aws_security_group |
Security groups |
aws_instance |
EC2 instances |
aws_ecs_cluster |
ECS clusters |
aws_ecs_service |
ECS services |
aws_eks_cluster |
EKS clusters |
aws_db_instance |
RDS instances |
aws_lambda_function |
Lambda functions |
Drift kinds reported:
| Kind | Meaning |
|---|---|
missing |
Terraform expects this, AWS doesn't have it |
orphan_in_aws |
AWS has it, Terraform doesn't (manual change) |
orphan_listener |
TF expected a listener TG, but no live listener routes there |
Exits non-zero on drift โ use as a CI gate:
- run: sudiviz drift --tfstate plan.json --json > drift.json
๐ค CI / scripting (--json)
Every command emits machine-readable JSON with --json:
# Fail CI if any critical issue exists
sudiviz diagnose --region us-east-1 --json | jq '.diagnosis.fixes[] | select(.severity=="critical")'
# Drift as a CI gate
sudiviz drift --tfstate tfstate.json --json
Exit codes:
| Code | Meaning |
|---|---|
0 |
No critical findings / no drift |
1 |
Drift detected (drift command) |
2 |
At least one critical fix (diagnose command) |
๐ง Automated remediation (sudiviz fix)
sudiviz can automatically fix diagnosed issues โ not just report them.
Usage
sudiviz fix # List all fixes (dry-run)
sudiviz fix 1 # Show fix #1 only
sudiviz fix 1 --apply # Apply fix #1
sudiviz fix 1,3 --apply # Apply fixes #1 and #3
sudiviz fix 1-3 --apply # Apply fixes #1, #2, and #3
sudiviz fix --apply # Apply all fixes
sudiviz fix --apply --force # Apply all fixes including destructive ones
Example output
$ sudiviz fix
Proposed fixes (dry-run):
1. CRITICAL Security group missing port 80 from ALB SG
Add inbound rule to sg-instance: allow TCP/80 from sg-alb
aws ec2 authorize-security-group-ingress \
--region us-east-1 \
--group-id sg-instance \
--protocol tcp \
--port 80 \
--source-group sg-alb
2. WARNING S3 bucket 'my-bucket': server-side encryption not enabled
Enable SSE-S3 encryption on bucket: my-bucket
aws s3api put-bucket-encryption \
--bucket my-bucket \
--server-side-encryption-configuration ...
Run with --apply to execute these fixes.
Supported auto-fixes
| Issue | Fix applied |
|---|---|
| Security group missing port from ALB SG | ec2:AuthorizeSecurityGroupIngress |
| S3 public access not blocked | s3:PutPublicAccessBlock |
| S3 encryption not enabled | s3:PutBucketEncryption |
| RDS publicly accessible | rds:ModifyDBInstance |
| Orphan target group | elbv2:DeleteTargetGroup (requires --force) |
| Unused security group | ec2:DeleteSecurityGroup (requires --force) |
IAM permissions required
For sudiviz diagnose (read-only):
ReadOnlyAccess(AWS managed policy)
For sudiviz fix --apply (write operations):
AmazonEC2FullAccessโ security group fixesElasticLoadBalancingFullAccessโ delete orphan target groupsAmazonS3FullAccessโ S3 encryption and public access fixesAmazonRDSFullAccessโ RDS public accessibility fixes
Safety
- Dry-run by default โ always shows what would change before applying
- Destructive operations require
--forceโ delete operations won't run without explicit flag - Selective application โ apply specific fixes by number instead of all at once
๐๏ธ Continuous monitoring
sudiviz watch --interval 30 --region us-east-1
Re-runs full discovery + analysis every --interval seconds. Pair with
tmux for an always-on dashboard. The web mode (sudiviz graph --output web)
is more ergonomic for long-running monitoring โ it auto-refreshes via
WebSocket and lets you inspect nodes interactively.
๐ ๏ธ Additional commands
sudiviz compare --baseline graph.jsonโ diff a saved snapshot vs live topology (shows added/removed nodes).sudiviz share --uploadโ push graph JSON to transfer.sh for an ephemeral public link.sudiviz diagnose --speakโ macOSsayreads the top fixes aloud.
๐๏ธ Architecture
sudiviz/
โโโ cli.py # Typer commands: diagnose, drift, graph, tui, watch, compare, share
โโโ tui.py # Textual TUI โ live table + details pane
โโโ web.py # FastAPI + WebSocket broadcast loop
โโโ discovery/
โ โโโ aws.py # boto3 + asyncio.to_thread โ ECS/EKS/RDS/Lambda/S3/ALB/EC2/SG
โ โโโ terraform.py # `terraform show -json` parser + drift detection
โ โโโ models.py # Pydantic v2 โ provider-agnostic data models
โโโ graph/
โ โโโ builder.py # NetworkX DiGraph construction
โ โโโ analyzer.py # Orphan detection + diagnostic rules + fix suggestions
โ โโโ visualizer.py # Terminal (Rich) / Cytoscape JSON / PNG (Graphviz)
โโโ web_templates/
โ โโโ index.html # Cytoscape.js app + WebSocket client
โ โโโ style.css # Dark topbar, health-state colours, orphan pulse animation
โ โโโ cytoscape.js # Bundled Cytoscape (offline fallback)
โโโ utils/
โโโ auth.py # boto3 session + STS identity + AWS Console URL builder
โโโ reachability.py # VPC Reachability Analyzer integration (opt-in, paid)
โโโ branding.py # Logo, version, shared colour palette
Multi-cloud ready. All discovery returns Pydantic types defined in
discovery/models.py. AWS-specific code is isolated to discovery/aws.py.
Add discovery/azure.py or discovery/gcp.py to extend without touching
the graph or visualization layer.
โก Performance
- All boto3 calls run via
asyncio.to_threadโ parallel discovery with no extra dependencies. - New service discovery (ECS, EKS, RDS, Lambda, S3) runs in the same parallel gather as ALB/EC2 โ no extra latency.
- If any individual service fails (e.g. no EKS in the account), it logs a warning and returns an empty list โ the rest of discovery continues.
- botocore retries are configured
mode="adaptive"(exponential backoff + jitter). - Pagination is fully drained for every API.
- The web server caches the latest discovery โ multiple browser tabs don't trigger multiple sweeps.
๐ค Publishing to PyPI
pip install build twine
python -m build
python -m twine upload dist/*
After upload, anyone can install with:
pip install sudiviz
pip install 'sudiviz[all]'
Project details
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 sudiviz-0.3.1.tar.gz.
File metadata
- Download URL: sudiviz-0.3.1.tar.gz
- Upload date:
- Size: 69.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1db470101d134cdee5fb9d44426a376c3b0318af58c9b7e528ecd514e3698e0f
|
|
| MD5 |
30b0e507ddab4aa7625c7a93eb7572e9
|
|
| BLAKE2b-256 |
3a98868192ad98d05f01078b66ce7d0e3d3526eb99ba600295a0ad50325c7837
|
File details
Details for the file sudiviz-0.3.1-py3-none-any.whl.
File metadata
- Download URL: sudiviz-0.3.1-py3-none-any.whl
- Upload date:
- Size: 66.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f113211e8b9e72c58566d450c5f3e1f3c40e3c6816fb0dc0fc314a343168806e
|
|
| MD5 |
3d1056ad6646e6ed899ddd55e2b40676
|
|
| BLAKE2b-256 |
3a96fdd61e812f1209ca0fb35b3117e2dd89a1fddee4be4959137323a92a06c2
|