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

brew install pipx && pipx install cloudbrain-cli

That's it. cloudbrain is now available globally.

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.2.tar.gz (42.9 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.2-py3-none-any.whl (64.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cloudbrain_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7fb6a9fb6b478f6f5bd1b63ff78858ff909a0e310607bf88aa63f4bea4f26f83
MD5 120f4daa45b27a9083cd6c46abbb5641
BLAKE2b-256 9cbbabdde4dd46b1bf6398480b59e69dceee3794395a3bd232eef65bd0466661

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for cloudbrain_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 16fb48068d545db43fe1ae08f9e94d68ee2255fe1ad54839093a121941664484
MD5 f38cf1d4ebcdf14db554e112999095fa
BLAKE2b-256 6be2809cb1fff88cf829a774ddb6c08587182b107439c304fc3ab0b940c792be

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