Skip to main content

A kill-switch for AWS that automatically deletes resources when spending limits are breached.

Project description

💰 CostCutter

Your AWS Budget's Last Line of Defense

Python Version License: MIT PyPI version

An automated kill-switch for AWS accounts that prevents bill shock by cleaning up resources when spending limits are breached.

FeaturesQuick StartInstallationDocumentationContributing

[!CAUTION] ⚠️ DESTRUCTIVE TOOL WARNING

CostCutter will delete AWS resources aggressively and indiscriminately once triggered. This is not a reversible operation. All data will be permanently lost.

🎯 What is CostCutter?

CostCutter is a serverless AWS cost protection system that acts as an emergency brake for your cloud spending. It continuously monitors your AWS Budget and automatically triggers resource cleanup when costs exceed your predefined thresholds—ensuring you never wake up to a surprise $10,000 bill from a forgotten EC2 instance.

Perfect for:

  • 🎓 Students learning AWS who fear accidental charges
  • 🧪 Experimenters testing AWS services without financial risk
  • 🏖️ Sandbox environments that need automatic teardown
  • 💡 Side projects with strict budget constraints
  • 🚀 Hackathons where resources must be cleaned up after events

✨ Features

🎛️ Powerful Control & Safety

  • 🏃 Dry Run Mode - Test what would be deleted without actually deleting anything
  • 🎯 Multi-Region Support - Clean resources across all AWS regions or specific ones
  • ⚙️ Flexible Configuration - YAML-based config with environment variable overrides
  • 📊 Detailed Reporting - Live tables, summaries, and optional CSV exports
  • 🔗 Dependency-Aware - Handles resource dependencies in the correct order
  • 🐍 Type-Safe - Fully typed Python codebase with Pydantic validation

🚀 Deployment Flexibility

  • 💻 CLI Mode - Run manually from your terminal
  • ☁️ Lambda Mode - Deploy as serverless function triggered by AWS Budgets via SNS

🚀 Quick Start

Installation

Run CostCutter with uvx (no global install required):

# Run without installing (recommended)
uvx costcutter --version

# Safe dry run
uvx costcutter --dry-run

For full setup and configuration, see the documentation: https://costcutter.hyperoot.dev

Basic Usage

# Dry run (safe mode - shows what would be deleted)
costcutter --dry-run

# Real execution (destructive!)
costcutter

# Use custom config
costcutter --config ./my-config.yaml

Example Configuration

Create a costcutter.yaml:

aws:
  region:
    - us-east-1
    - eu-west-1
  services:
    - ec2
    - s3
    - elasticbeanstalk

output:
  log_level: INFO
  report_format: csv
  report_path: ./cleanup-report.csv

📚 Documentation

📖 Full Documentation

🤝 Contributing

We welcome contributions! CostCutter is intentionally modular to make adding new AWS services easy.

How to Contribute

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/add-rds-cleanup
  3. Follow the coding standards (see .github/copilot-instructions.md)
  4. Add tests for your changes
  5. Submit a pull request

Adding New Services

Check out our guides:

⚖️ License

This project is licensed under the MIT License - see the LICENSE file for details.

⚠️ Disclaimer

USE AT YOUR OWN RISK.

CostCutter is a destructive tool designed to permanently delete AWS resources. The authors and contributors are not responsible for:

  • Data loss
  • Service interruptions
  • Unintended deletions
  • Financial consequences
  • Any other damages resulting from the use of this tool

Always test in a safe environment first. Always use dry-run mode before actual execution. Always maintain proper backups.

🙏 Acknowledgments

Built with ❤️ by HYP3R00T

Powered by:

  • boto3 - AWS SDK for Python
  • Typer - CLI framework
  • Rich - Beautiful terminal output
  • Pydantic - Data validation
  • UV - Fast Python package manager

⭐ Star us on GitHub if CostCutter saved you from a surprise AWS bill!

Report BugRequest FeatureDiscussions

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

costcutter-0.1.4a1.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

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

costcutter-0.1.4a1-py3-none-any.whl (41.0 kB view details)

Uploaded Python 3

File details

Details for the file costcutter-0.1.4a1.tar.gz.

File metadata

  • Download URL: costcutter-0.1.4a1.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for costcutter-0.1.4a1.tar.gz
Algorithm Hash digest
SHA256 84d957a7980170f1b2685e4dcc6749b2b2e2929531636b5913c96337d3f4843d
MD5 383aa0d7c22250aebbea7ecac83f45ec
BLAKE2b-256 32a2d17e3ca68af74323dd631f552363cc915563001ee3f3b31818ee0abc4c6b

See more details on using hashes here.

File details

Details for the file costcutter-0.1.4a1-py3-none-any.whl.

File metadata

  • Download URL: costcutter-0.1.4a1-py3-none-any.whl
  • Upload date:
  • Size: 41.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for costcutter-0.1.4a1-py3-none-any.whl
Algorithm Hash digest
SHA256 fcef21345d9c29e6861fb5cd1a70eede445933bcd000fd2ea4a46dd30dfb494d
MD5 4505b7fb8d3df77e069683a6a02ba627
BLAKE2b-256 0087cdd5f8c0d03f266c704ac218fec03c2cea39835470b7b9eb56a0c019be70

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