Skip to main content

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

Install

pip install cloudbrain-cli

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'
        ├─ 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'
        ├─ State: RUNNING (idle for 60 min)
        ├─ Node type: i4i.2xlarge × 2 workers
        ├─ 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 configure or 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

cloudbrain_cli-0.1.1.tar.gz (42.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloudbrain_cli-0.1.1-py3-none-any.whl (64.4 kB view details)

Uploaded Python 3

File details

Details for the file cloudbrain_cli-0.1.1.tar.gz.

File metadata

  • Download URL: cloudbrain_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 42.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for cloudbrain_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8deb60dafc6a68bf99aa9a4aa3f8bdb1ec7b43673cef0db21acba9ad44bd5ece
MD5 ed453ad48072f79d792b6a110093cb1f
BLAKE2b-256 773271f7d3ccca49ab2e4cbff4cb4708b2e1a9309de25cf50d1356655d69906a

See more details on using hashes here.

File details

Details for the file cloudbrain_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cloudbrain_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 64.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for cloudbrain_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8b93c78778825178cb28cfc0c8083c12183e1c722412f8e89a1994f39eb7ab8a
MD5 2b7f00a944e513ddd5f994e47ddf1622
BLAKE2b-256 2c7e04dcf54f43cd46a1607a007674dc2609f56914b31cbb6966f33b8fc8b6f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page