Metadata-Version: 2.3
Name: costcutter
Version: 0.1.2
Summary: A kill-switch for AWS that automatically deletes resources when spending limits are breached.
Keywords: aws,budget,cost,cost-control,cleanup,devops,security,utilities
Author: hyperoot
Author-email: hyperoot <rajesh@hyperoot.dev>
License: MIT License
         
         Copyright (c) 2025 hyperoot.dev
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Classifier: Natural Language :: English
Requires-Dist: boto3>=1.40.1
Requires-Dist: pyfiglet>=1.0.3
Requires-Dist: pydantic>=2.0.0
Requires-Dist: rich>=14.1.0
Requires-Dist: typer>=0.16.0
Requires-Dist: utilityhub-config>=0.2.0
Requires-Dist: zensical>=0.0.20
Requires-Python: >=3.12
Project-URL: Homepage, https://github.com/HYP3R00T/costcutter
Project-URL: Issues, https://github.com/HYP3R00T/costcutter/issues
Project-URL: Repository, https://github.com/HYP3R00T/costcutter
Description-Content-Type: text/markdown

<div align="center">

# 💰 CostCutter

### *Your AWS Budget's Last Line of Defense*

[![Python Version](https://img.shields.io/badge/python-3.13%2B-blue.svg?style=for-the-badge)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
[![PyPI version](https://img.shields.io/pypi/v/costcutter.svg?style=for-the-badge)](https://pypi.org/project/costcutter/)

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

[Features](#-features) • [Quick Start](#-quick-start) • [Installation](#-installation) • [Documentation](#-documentation) • [Contributing](#-contributing)

</div>

> [!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):

```bash
# 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

```bash
# 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`:

```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](https://hyperoot.github.io/CostCutter/)**

- [What is CostCutter?](https://hyperoot.github.io/CostCutter/guide/what-is-costcutter.html)
- [Getting Started Guide](https://hyperoot.github.io/CostCutter/guide/getting-started.html)
- [Configuration Reference](https://hyperoot.github.io/CostCutter/guide/config-reference.html)
- [Supported Services](https://hyperoot.github.io/CostCutter/guide/supported-services.html)
- [How It Works](https://hyperoot.github.io/CostCutter/guide/how-it-works.html)
- [Terraform Integration](https://hyperoot.github.io/CostCutter/usage-terraform.html)
- [Contributing Guide](https://hyperoot.github.io/CostCutter/contributing/)

## 🤝 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:
- [Adding a Service](https://hyperoot.github.io/CostCutter/contributing/adding-service.html)
- [Adding Subresources](https://hyperoot.github.io/CostCutter/contributing/adding-subresources.html)
- [Code Structure](https://hyperoot.github.io/CostCutter/contributing/code-structure.html)

## ⚖️ License

This project is licensed under the **MIT License** - see the [LICENSE](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](https://github.com/HYP3R00T)

Powered by:
- [boto3](https://github.com/boto/boto3) - AWS SDK for Python
- [Typer](https://github.com/fastapi/typer) - CLI framework
- [Rich](https://github.com/Textualize/rich) - Beautiful terminal output
- [Pydantic](https://github.com/pydantic/pydantic) - Data validation
- [UV](https://github.com/astral-sh/uv) - Fast Python package manager

<div align="center">

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

[Report Bug](https://github.com/HYP3R00T/CostCutter/issues) • [Request Feature](https://github.com/HYP3R00T/CostCutter/issues) • [Discussions](https://github.com/HYP3R00T/CostCutter/discussions)

</div>
