GCP Radar
GCP Resource Inventory Scanner & Architecture Diagram Generator
A Python CLI tool that inventories all your GCP resources and generates beautiful draw.io architecture diagrams.
Features
- 🔍 Inventory Scanning: Scans Compute Engine, Cloud SQL, Cloud Functions, GKE, Cloud Storage, Cloud Run, Firestore, Pub/Sub, and more
- 💰 Commitment Export: Pull every committed use discount (CUD) across a whole billing account to CSV
- 📊 CSV Export: Export complete inventory to CSV for further analysis
- 🏗️ Architecture Diagrams: Auto-generate draw.io
.drawiofiles with logical service connections - ☁️ Multi-Project Support: Scan multiple GCP projects in one go
- 🔐 Service Account Auth: Use gcloud default credentials or specify service account key
Installation
pip install gcp-radar
Or from source:
git clone https://github.com/yourname/gcp-radar.git
cd gcp-radar
pip install -e .
Quick Start
1. Inventory Your GCP Resources
# Scan default project
gcp-radar inventory --export inventory.csv
# Scan specific project
gcp-radar inventory --project my-project --export inventory.csv
# Export to specific region
gcp-radar inventory --region us-central1 --export inventory.csv
2. Export Committed Use Discounts (CUDs)
# Every commitment on the billing account funding your current project
gcp-radar commitments --export commitments.csv
# Pick the billing account explicitly
gcp-radar commitments --billing-account 01ABCD-EF2345-6789GH --export commitments.csv
# Single project, or a single region
gcp-radar commitments --project my-project --export commitments.csv
gcp-radar commitments --region us-central1
# Or fold commitments into a regular inventory scan
gcp-radar inventory --commitments --export inventory.csv
Without --project, gcp-radar resolves the billing account, lists every project
attached to it, and scans each one — so you get all commitments on the account,
not just the current project's.
3. Generate Architecture Diagram
gcp-radar diagram --input inventory.csv --output architecture.drawio
# Then open architecture.drawio in app.diagrams.net or the desktop app
4. One-Shot: Scan + Diagram
gcp-radar run --project my-project \
--output-csv inventory.csv \
--output-diagram architecture.drawio
Supported GCP Services
| Service | Collected | Diagram |
|---|---|---|
| Compute Engine | ✓ | ✓ |
| Cloud SQL | ✓ | ✓ |
| Cloud Functions | ✓ | ✓ |
| GKE (Kubernetes Engine) | ✓ | ✓ |
| Cloud Storage | ✓ | ✓ |
| Cloud Run | ✓ | ✓ |
| Firestore | ✓ | ✓ |
| Pub/Sub | ✓ | ✓ |
| Committed Use Discounts | ✓ | – |
Requirements
- Python 3.9+
- GCP credentials (via
gcloud author service account key) - Permissions:
compute:Read,sql:Read,container:Read,storage:Read,pubsub:Read,firestore:Read, etc. - For
commitments:compute.commitments.liston each project, plusbilling.resourceAssociations.liston the billing account (to enumerate its projects) — e.g. roles/billing.viewer
Output Format
CSV Inventory
| ProjectID | Service | Name | ID | Type/Size | Status | Region | Extra |
|---|---|---|---|---|---|---|---|
| my-project | Compute Engine | web-01 | abc123 | n1-standard-2 | RUNNING | us-central1 | ... |
CSV Commitments
| BillingAccount | ProjectID | Name | ID | Region | Status | Plan | Type | Category | AutoRenew | StartTime | EndTime | vCPU | MemoryGB | LocalSSDGB | AcceleratorCount | AcceleratorType | Resources | Reservations | StatusMessage |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01ABCD-EF2345-6789GH | my-project | cud-1 | 42 | us-central1 | ACTIVE | TWELVE_MONTH | GENERAL_PURPOSE_N2D | MACHINE | True | 2026-01-01T00:00:00Z | 2027-01-01T00:00:00Z | 32 | 128.0 | 0 | 0 | - | VCPU:32, MEMORY:131072 | - | - |
Architecture Diagram
Auto-generated .drawio file with:
- Swim lanes by service category (Compute, Database, Storage, Messaging)
- Icons for each resource
- Logical connections between services
Configuration
Create a .env file to override defaults:
export GCP_PROJECT=my-project
export GCP_REGION=us-central1
Or pass flags:
gcp-radar inventory --project my-project --region us-central1
License
MIT
Contributing
Pull requests welcome! Please open an issue first to discuss changes.
Support
GitHub Issues: https://github.com/yourname/gcp-radar/issues
Release files for gcp-radar 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gcp_radar-1.1.0.tar.gz | 24.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gcp_radar-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 46.8 kB
Release files / gcp_radar-1.1.0.tar.gz
| Download URL | gcp_radar-1.1.0.tar.gz |
|---|---|
| Size | 24.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52527aaf52bd082fe889173b7ad96ba524e30bdfaaf6128cee51e00dd36b3fbf
|
|
BLAKE2b-256 checksum How to use checksums |
34a13fdee798d2ef20a6e3f8715e7bdcab472f2bb8dff127578777823d460859
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / gcp_radar-1.1.0-py3-none-any.whl
| Download URL | gcp_radar-1.1.0-py3-none-any.whl |
|---|---|
| Size | 21.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f28772e9df03a8368f6eeee4486ce053dae7963cc513ed22d5f441c1acf4935
|
|
BLAKE2b-256 checksum How to use checksums |
fdf8922ceba332ae4edb607987e342ef4d7693f156b31933580f1fce7f2bf0fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|