Infrastructure Cost Intelligence CLI — safe, read-only cloud cost optimization scanner for AWS and Databricks
Project description
cloudbrain
Infrastructure Cost Intelligence CLI — a safe, read-only scanner that identifies cloud infrastructure waste and generates optimization recommendations.
What it does
- Scans AWS and Databricks environments using read-only API access
- Identifies idle, underutilized, and misconfigured resources
- Estimates monthly savings potential with exact current vs recommended config
- Prioritizes recommendations by savings impact and risk level
- Scans: clusters, SQL warehouses, jobs, Unity Catalog, compute policies
- Outputs reports to terminal, JSON, or CSV
Quick Start
# Clone the repo
git clone https://github.com/makebeen/cloudbrain.git
cd cloudbrain
# Create virtual environment and install
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
# Initialize config (optional — sets custom thresholds)
cloudbrain init
Usage
Scan
# Scan Databricks
export DATABRICKS_HOST="https://your-workspace.cloud.databricks.com"
export DATABRICKS_TOKEN="dapi..."
cloudbrain scan --provider databricks
# Scan AWS
export AWS_ACCESS_KEY_ID="your_key"
export AWS_SECRET_ACCESS_KEY="your_secret"
cloudbrain scan --provider aws
# Scan both providers
cloudbrain scan --provider aws --provider databricks
# Scan specific AWS regions
cloudbrain scan --provider aws --regions us-east-1,eu-west-1
Export
After running a scan, save the report without re-scanning:
# Save as JSON (to ~/Downloads)
cloudbrain export json
# Save as CSV (to ~/Downloads)
cloudbrain export csv
Commands
| Command | Description |
|---|---|
cloudbrain scan --provider <name> |
Run a cost scan (results shown in terminal) |
cloudbrain export json |
Save last scan as JSON to ~/Downloads |
cloudbrain export csv |
Save last scan as CSV to ~/Downloads |
cloudbrain init |
Generate default config at ~/.cloudbrain/config.yaml |
cloudbrain --version |
Show version |
cloudbrain --help |
Show help |
What it scans
Databricks
| Resource | Checks |
|---|---|
| Clusters | Idle detection, auto-termination config, autoscaling config, oversized drivers |
| SQL Warehouses | Auto-stop config, sizing vs query rate, multi-cluster over-provisioning |
| Jobs | Failure rates, expensive jobs, long-running jobs, cost per run |
| Unity Catalog | Catalogs, schemas, Delta table optimization, external locations |
| Compute Policies | Missing policies, weak policies, clusters without policies |
AWS
| Resource | Checks |
|---|---|
| EC2 | Idle instances (<5% CPU), underutilized instances, rightsizing suggestions |
| EBS | Orphaned volumes, old unattached snapshots |
| S3 | Missing lifecycle policies, infrequent access candidates |
| ELB | Load balancers with no healthy targets |
| Elastic IPs | Unassociated IPs (charged hourly) |
| NAT Gateways | Low-traffic gateways |
Security Model
- Read-only access only — never modifies your infrastructure
- No data exfiltration — all processing happens locally on your machine
- No database — nothing stored except a local cache of the last scan
- Least-privilege IAM — requires only Describe/List/Get permissions
- Credential safety — credentials never written to disk or logs
Configuration
# Generate default config
cloudbrain init
# Config location: ~/.cloudbrain/config.yaml
Configurable thresholds include:
observation_window_days— how far back to look (default: 90)cpu_idle_percent— CPU threshold for idle classification (default: 5%)cpu_underutilized_percent— CPU threshold for rightsizing (default: 20%)cluster_idle_minutes— idle time before flagging (default: 30)warehouse_low_query_rate— queries/hour threshold (default: 5)
Example Output
💰 Estimated Monthly Savings: $16,704.87
📋 Total Findings: 148 (31 with cost impact)
━━━ Actionable Findings (31) ━━━
#1 [MEDIUM RISK] OVERSIZED WAREHOUSE — $1,460.00/mo
SQL Warehouse 'prod-serverless-analytics-sql-warehouse' (ID: 4771ef02b037920c)
├─ Size: Small | Queries: 0.0/hr
├─ CURRENT CONFIG: cluster_size = Small ($4.00/hr)
├─ RECOMMENDED: cluster_size = X-Small ($2.00/hr)
└─ ESTIMATED SAVINGS: $1460.00/mo
#2 [LOW RISK] IDLE CLUSTER — $903.38/mo
Cluster 'catalog-inventory-pipeline-compute' (ID: 0519-141414-thg3vb7z)
├─ State: RUNNING (idle for 60 min)
├─ Node type: i4i.2xlarge × 2 workers
├─ Auto-termination: 10 min
├─ Current cost: $1.24/hr ($903.38/mo if always on)
├─ Wasted so far this idle period: $1.23
└─ ACTION: Terminate now or set auto-termination to 30 min
Requirements
- Python 3.11+
- AWS credentials (for AWS scanning) — configured via
aws configureor environment variables - Databricks PAT (for Databricks scanning) — generated from workspace settings
License
MIT
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 cloudbrain_cli-0.1.0.tar.gz.
File metadata
- Download URL: cloudbrain_cli-0.1.0.tar.gz
- Upload date:
- Size: 43.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41a39e07152ffb94432fd7d5748d2d578d9c4811dfe9dc6009b4a33253e01b77
|
|
| MD5 |
fd970ae7a0f6f3018ec706654945b678
|
|
| BLAKE2b-256 |
3eae8303b412f78a9b3c15ba4b384583f99e7d64924d1e194198b86159b4d0c3
|
File details
Details for the file cloudbrain_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cloudbrain_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 64.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edc2714f7882d00545f59a24d9c5b53d5ac6c91592a73c5388886de77a53d5f1
|
|
| MD5 |
a7d98d6cb110dd98e2a1ac82963181e5
|
|
| BLAKE2b-256 |
5168db51ad15542f582ff425b469f98eeaff104e484a41571283e56101258e0f
|