Open-source cloud cost optimization. Detect idle EC2 instances. Remediate with one click.
Requirements: Docker, Python 3.11+, AWS credentials (aws configure)
git clone https://github.com/wastelessio/wasteless.git
cd wasteless
./install.sh # Installs everything (backend + UI + DB)
source ~/.zshrc
wasteless # Start the web UIThen collect data and detect waste:
source venv/bin/activate
python3 src/collectors/aws_cloudwatch.py # Collect metrics
python3 src/detectors/ec2_idle.py # Detect waste┌─────────────────────────────────────────────────────────┐
│ AWS Account │
│ CloudWatch API · Cost Explorer · EC2 │
└──────────────────────┬──────────────────────────────────┘
│ boto3
┌──────────────────────▼──────────────────────────────────┐
│ wasteless │
│ │
│ collectors/ → Fetch CloudWatch metrics │
│ detectors/ → Identify idle EC2 instances │
│ remediators/ → Stop / terminate instances │
│ trackers/ → Verify actual savings │
└──────────────────────┬──────────────────────────────────┘
│ psycopg2
┌──────────────────────▼──────────────────────────────────┐
│ PostgreSQL │
│ ec2_metrics · waste_detected · recommendations │
│ actions_log · rollback_snapshots · savings_realized │
└──────────────────────┬──────────────────────────────────┘
│
┌──────────────────────▼──────────────────────────────────┐
│ ui/ (FastAPI) │
│ Dashboard · Recommendations · History │
│ :8888 │
└─────────────────────────────────────────────────────────┘
wasteless/
├── src/
│ ├── collectors/ # CloudWatch metrics collection
│ ├── detectors/ # EC2 idle waste detection
│ ├── remediators/ # Stop / terminate execution
│ ├── trackers/ # Savings verification
│ └── core/ # Database, safeguards
├── ui/ # FastAPI web dashboard
│ ├── main.py
│ ├── templates/
│ ├── utils/
│ ├── install.sh
│ └── start.sh
├── sql/ # Database schema + migrations
├── config/
│ └── remediation.yaml # Safeguards and policies
├── docker-compose.yml # PostgreSQL (+ Metabase optionnel)
└── requirements.txt
Copy .env.template to .env:
| Variable | Default | Description |
|---|---|---|
AWS_REGION |
us-east-1 |
AWS region |
AWS_ACCESS_KEY_ID |
(required) | AWS access key |
AWS_SECRET_ACCESS_KEY |
(required) | AWS secret key |
DB_HOST |
localhost |
PostgreSQL host |
DB_PORT |
5432 |
PostgreSQL port |
DB_NAME |
wasteless |
Database name |
DB_USER |
wasteless |
Database user |
DB_PASSWORD |
(required) | Database password |
Edit config/remediation.yaml:
| Setting | Default | Description |
|---|---|---|
auto_remediation.enabled |
false |
Enable autonomous execution |
auto_remediation.dry_run_days |
7 |
Mandatory dry-run period |
protection.min_instance_age_days |
30 |
Ignore instances younger than N days |
protection.min_idle_days |
14 |
Must be idle for N+ days |
protection.min_confidence_score |
0.80 |
Minimum detection confidence |
protection.max_instances_per_run |
3 |
Max instances stopped per run |
Whitelist instances by ID or tag:
whitelist:
instance_ids:
- i-0123456789abcdef0
tags:
Environment: productionMinimum required policy:
{
"Action": [
"cloudwatch:GetMetricStatistics",
"cloudwatch:ListMetrics",
"ec2:Describe*",
"ec2:StopInstances",
"ce:GetCostAndUsage"
]
}Before executing any action, Wasteless validates 7 conditions:
- Auto-remediation enabled in config
- Instance not in whitelist
- Instance age >= 30 days
- Detection confidence >= 80%
- Idle duration >= 14 consecutive days
- Current time in allowed schedule window
- Instances stopped this run < max limit
If any check fails → action aborted and logged.
| Feature | Description |
|---|---|
| Detection | CPU / network analysis with confidence scoring |
| Recommendations | Stop / terminate / downsize actions |
| Dry-Run Mode | Test safely before any AWS action |
| Auto-Sync | Background sync every 5 min with AWS |
| Action History | Full audit trail with rollback snapshots |
| Cloud Inventory | Live EC2 inventory across regions |
| Whitelist | Exclude instances from recommendations |
| Savings Tracking | Verified actual savings via Cost Explorer |
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Home dashboard |
/recommendations |
GET | Pending recommendations |
/history |
GET | Action history |
/cloud-resources |
GET | EC2 inventory |
/settings |
GET | Configuration |
/api/metrics |
GET | JSON metrics |
/api/actions |
POST | Approve / reject |
/api/config |
POST | Update config |
/api/whitelist |
POST | Add to whitelist |
/api/sync-aws |
POST | Trigger manual sync |
| OS | Status |
|---|---|
| macOS | Supported |
| Linux | Supported |
| Windows (WSL2) | Supported |
| Windows (native) | Not supported |
# Backend tests
python tests/test_end_to_end.py
# UI hot reload
cd ui && ./start.sh
# UI tests
cd ui && python run_tests.py- EC2 idle detection and remediation
- Web dashboard (FastAPI)
- Dry-run mode and safeguards
- Savings verification
- RDS / EBS / S3 detection
- Multi-account AWS support
- Slack / Teams notifications
- Azure and GCP support
Apache 2.0
- Issues: GitHub Issues
- Contact: wasteless.io.entreprise@gmail.com