Read-only AWS cost-drain scanner across regions with estimated monthly savings (MIT, free; pipx install) https://errant.solutions/tools/aws-waste-finder.html
  • Python 87.8%
  • Shell 12.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Claude Code 1b97916457
All checks were successful
tests / audit (push) Successful in 25s
release / release (push) Successful in 29s
tests / test (3.8) (push) Successful in 1m36s
tests / test (3.14) (push) Successful in 2m26s
release 1.3.1: version bump + CHANGELOG for the storedBytes default cleanup (the site download must be a released tag)
2026-12-01 12:41:39 -08:00
.forgejo/workflows ci(mutation): run the mutants in three sequential jobs (ci/mutation.sh MUT_PART=k/n) so each fits Forgejo's ~3 h task limit 2026-11-26 05:27:11 -08:00
ci ci(mutation): run the mutants in three sequential jobs (ci/mutation.sh MUT_PART=k/n) so each fits Forgejo's ~3 h task limit 2026-11-26 05:27:11 -08:00
docs Shared CLI contract: exit codes, --json schema_version, --quiet, contract tests 2026-11-23 14:51:10 -08:00
keys release: sign SHA256SUMS with the Errant Solutions release key 2026-11-17 10:27:14 -08:00
schema Shared CLI contract: exit codes, --json schema_version, --quiet, contract tests 2026-11-23 14:51:10 -08:00
tests tests: in-process contract tests for find_waste/_check/pages/enabled_regions/main (scripted session: exact finding dicts, per-check error keys, API arguments, ClientError shapes, help body) killing 74 of the 75 survivors the nightly mutation gate flagged; local mutmut on those 75: 1 left, x_find_waste__mutmut_938 (g.get("storedBytes", None) or 0, equivalent to the original default 0). Root cause of the red: the mutation-baseline branch holds survivors=[] / last_full=None (written by a no-diff skip, never by a full run), so every pre-existing survivor of a function the diff touches counts as new; a full run records them (floor unchanged at 65). 2026-11-27 11:04:22 -08:00
.gitignore nightly mutation: incremental (only functions changed since the last green run) except a weekly full run on the repo's own weekday; replace-queued concurrency; staggered cron 2026-10-18 12:22:45 -07:00
aws_waste_finder.py release 1.3.1: version bump + CHANGELOG for the storedBytes default cleanup (the site download must be a released tag) 2026-12-01 12:41:39 -08:00
CHANGELOG.md release 1.3.1: version bump + CHANGELOG for the storedBytes default cleanup (the site download must be a released tag) 2026-12-01 12:41:39 -08:00
claims.json Shared CLI contract: exit codes, --json schema_version, --quiet, contract tests 2026-11-23 14:51:10 -08:00
LICENSE AWS Waste Finder: read-only cost drain scanner (EBS, EIP, NAT, snapshots, idle LBs) 2026-09-15 08:16:12 -07:00
pyproject.toml docs: security contact moves to security@support.errant.solutions (author email in package metadata too); signing-key UID text unchanged 2026-11-30 10:29:36 -08:00
README.md Shared CLI contract: exit codes, --json schema_version, --quiet, contract tests 2026-11-23 14:51:10 -08:00
SECURITY.md docs: security contact moves to security@support.errant.solutions (author email in package metadata too); signing-key UID text unchanged 2026-11-30 10:29:36 -08:00

AWS Waste Finder

A single-file, read-only Python script that finds the most common silent AWS cost drains in one region, several, or every enabled region, with an estimated monthly cost for each finding and a total:

Finding Estimate (us-east-1 list price)
Unattached EBS volumes size x $/GB-month for the volume type
gp2 volumes (gp3 is ~20% cheaper) size x $0.02
Unassociated Elastic IPs $0.005/h = $3.65/mo
Stopped EC2 instances (EBS still billed) their volumes
Old EBS snapshots (default > 90 days; AMI-backed ones are marked) size x $0.05 (upper bound: snapshots are incremental)
AMIs you own that no instance uses their snapshots
NAT Gateways $0.045/h = $32.85/mo + data
Idle ALB/NLB/GWLB (no healthy targets) and Classic ELBs (no InService instances) hourly LB price
RDS instances with no connections for --idle-days (CloudWatch) storage shown; instance hours depend on class/engine
Unattached network interfaces, empty log groups, log groups with no retention informational

Other RDS instances are listed for manual review only, never auto-flagged.

By Errant Solutions (errant.solutions), makers of Rustinion (device provisioning & monitoring), /Dev/Out Digital (security awareness training), OOPS! (hands-on security labs), and SSHerpa (Android SSH client).

Why

AWS bills accumulate small silent charges — an EBS volume nobody deleted after terminating an instance, an Elastic IP sitting unattached, a NAT Gateway from a torn-down VPC that never got cleaned up. Each one is a few dollars a month, but they add up, and nobody notices until the bill is already high. This tool is read-only — it never deletes or modifies anything, it just tells you what to go look at.

We built this after running it against our own AWS account and finding real waste (see below).

Install

pipx install git+https://git.canutethegreat.com/CanuteTheGreat/aws-waste-finder.git        # latest release branch; puts `aws-waste-finder` on PATH
pipx install git+https://git.canutethegreat.com/CanuteTheGreat/aws-waste-finder.git@v1.3.0  # a pinned release
brew install canutethegreat/errant-tools/aws-waste-finder   # after: brew tap canutethegreat/errant-tools https://git.canutethegreat.com/CanuteTheGreat/homebrew-errant-tools
scoop install errant-tools/aws-waste-finder                 # after: scoop bucket add errant-tools https://git.canutethegreat.com/CanuteTheGreat/scoop-errant-tools

Or download the single file (stdlib-only Python 3.8+; needs boto3) and run it directly: curl -fsSLO https://errant.solutions/downloads/aws_waste_finder.py && python3 aws_waste_finder.py --help. Every release has a changelog, the wheel, the sdist and a SHA256SUMS file. The checksums are signed (SHA256SUMS.asc). Verify: gpg --verify SHA256SUMS.asc SHA256SUMS (key: https://errant.solutions/signing-key.asc, fingerprint 5439 3549 39B9 C055 2A68 E9BB E323 A6A3 AC0A 6506, also in keys/release-signing.asc). Not on PyPI yet, so plain pipx install aws-waste-finder doesn't work until it's published there.

Usage

pipx install git+https://git.canutethegreat.com/CanuteTheGreat/aws-waste-finder.git   # brings boto3 along
aws-waste-finder --profile myprofile --region us-west-2
aws-waste-finder --region us-east-1 --region eu-west-1
aws-waste-finder --all-regions --json
aws-waste-finder --all-regions --min-savings 50     # CI/cron: exit 1 only for >= $50/month of waste

Options:

  • --profile NAME — AWS named profile (default: default credentials chain)
  • --region REGION — region to scan, repeatable (default: from profile/env)
  • --all-regions — every region enabled for the account (scanned in parallel)
  • --days N — flag snapshots older than N days (default: 90)
  • --idle-days N — RDS with no connections for N days is idle (default: 7)
  • --min-savings USD — exit 1 only when the estimated monthly total is at least USD
  • --prices FILE — JSON overriding the bundled prices (same keys as PRICES in the script), e.g. your region's
  • --json — {"schema_version", "tool", "version", "exit_code", "regions": {region: findings}, "region_errors", "estimated_monthly_usd", "prices"}; schema_version is currently 1 and the JSON Schema is schema/aws-waste-finder.schema.json
  • --quiet (-q) — print nothing on stdout, so the exit code is the whole answer; errors always go to stderr

Exit codes (the shared Errant Solutions CLI contract, see docs/CLI-CONTRACT.md): 0 nothing flagged (informational categories and RDS review entries don't count, nor does waste below --min-savings), 1 waste found, 2 bad usage, or (legacy, kept so existing scripts keep working) AWS can't be reached or isn't configured (no region, no credentials, unknown profile, API error, or every requested region failed) -- with a one-line explanation, not a traceback, 3 unexpected runtime error. A region that fails during --all-regions is listed in region_errors and the others are still reported; a single check that fails (e.g. a missing IAM permission) is shown as "check FAILED" in its section instead of "(none found)". Every listing is fully paginated.

Requires

  • Python 3.8+
  • boto3 (the only dependency; pipx/Homebrew install it for you)
  • Read-only IAM permissions: ec2:Describe*, elasticloadbalancing:Describe*, rds:Describe*, cloudwatch:GetMetricStatistics, logs:DescribeLogGroups

What it does NOT do

  • Never deletes, stops, or modifies any resource — report only.
  • Never guesses about busy RDS instances — only ones with zero connections are flagged.
  • Prices are bundled us-east-1 on-demand list prices; other regions, Savings Plans and reserved capacity change the real number (use --prices).

Support this work

This tool is free. If it saved you money and you want to say thanks: pay what you want via Stripe.

License

MIT — see LICENSE.

Tests

tests/ exercises every option and check end-to-end (against moto's AWS API server) in Forgejo CI on Python 3.8 and current Python; sh ci/run-tests.sh 3.13 reproduces it locally (needs docker).