Skip to main content

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 .drawio files 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 auth or service account key)
  • Permissions: compute:Read, sql:Read, container:Read, storage:Read, pubsub:Read, firestore:Read, etc.
  • For commitments: compute.commitments.list on each project, plus billing.resourceAssociations.list on 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.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gcp-radar 1.0.0
File Size Uploaded
gcp_radar-1.0.0.tar.gz 24.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gcp-radar 1.0.0
File Interpreter ABI Platform
gcp_radar-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 46.2 kB

Release files / gcp_radar-1.0.0.tar.gz

Download URL gcp_radar-1.0.0.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d9da100ae2d0b832ec36f9c2ce23aac603e7ee06d4738d340240ca4acccd6e7e
BLAKE2b-256 checksum
How to use checksums
f6ee936f2b039c2de08a6ad97ba1554fd509c9e26fda82c3562b82d7e82398b6
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.0.0-py3-none-any.whl

Download URL gcp_radar-1.0.0-py3-none-any.whl
Size 21.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09ba64d41fdf18446ecc6aef2f714105c6eccd4b2846e6a4a1fa3daea50e67f7
BLAKE2b-256 checksum
How to use checksums
a3b3e91d5845dfe8283dd0e5f5575a80e880a651f66d648e35aeb2977ff91f2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

This release

1.0.0 This release

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.9

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page