CloudSlash – Find AWS waste and generate Terraform state rm commands
We've all been there: You find an unused NAT Gateway costing $45/mo. You delete it in the AWS console to stop the billing immediately. But the next time you run terraform plan, it fails because of state drift. Now you have to manually run terraform state rm or import it back to fix the drift. It's tedious, so often we just leave the waste running. I built CloudSlash to automate the cleanup and the state surgery. It’s written in Go (using BubbleTea for the TUI) and solves two engineering problems: 1. Finding "hollow" resources (the graph). Most cost tools just check CloudWatch metrics…
What it does
In the maker’s words, at launch
We've all been there: You find an unused NAT Gateway costing $45/mo. You delete it in the AWS console to stop the billing immediately. But the next time you run terraform plan, it fails because of state drift. Now you have to manually run terraform state rm or import it back to fix the drift. It's tedious, so often we just leave the waste running. I built CloudSlash to automate the cleanup and the state surgery. It’s written in Go (using BubbleTea for the TUI) and solves two engineering problems: 1. Finding "hollow" resources (the graph). Most cost tools just check CloudWatch metrics (CPU < 5%). That creates too much noise. Instead, I build an in-memory graph of the infrastructure to find structural waste. Example: An "Active" ELB. It has healthy targets, so metrics look good. But if you traverse the graph (ELB -> Instance -> Subnet -> Route Table), you might see the Route Table has no path to an Internet Gateway. The ELB is functionally dead, even if AWS reports it as "healthy." 2. The state mapping. Deleting the resource in AWS is easy. The challenge is mapping a physical ID (e.g., nat-0a1b2c) back to its Terraform address (e.g., module.vpc.aws_nat_gateway.public[0]) so you can remove it from the state file programmatically. I wrote a parser that reads your local .tfstate, handles the complex JSON structure (including nested modules and for_each outputs), and generates a remediation script. It outputs a shell script (fix_terraform.sh) that runs the necessary terraform state rm commands for you. It never writes to your .tf files directly—it just hands you the script to review and run. The core logic, scanner, and TUI are open source (AGPLv3). I charge a one-time license for the feature that auto-generates the fix scripts for developers , but the forensic analysis/detection is free. Repo: https://github.com/DrSkyle/CloudSlash
Does the same job
all alternatives →
- IBI built a service to help companies reduce AWS spend by 50%2022 · usage.ai · ▲123
Hey HN: Kaveh here, the founder of https://www.usage.ai/ We help companies drive down AWS EC2 spend. Why? Because the way it's done now is a pain. DevOps and Software Engineers end up spending time managing costs rather than focusing on business problems. Previous to founding Usage, I worked on high-performance computing research at JP Morgan Chase and as a software engineer at a number of smaller startups. Here's how it works: We are typically brought in by a DevOps manager to cut AWS EC2 costs. The app is entirely self-service and the savings are generated automatically,…
- DDDigger.dev – A PaaS that generates Terraform, in your AWS account2021 · diggerdev.com · ▲142
- IBI built a service to help companies save on their AWS bills2020 · ▲73
Hey HN: I'm Kaveh, the founder of Usage (https://www.usage.ai/) We help companies drive down AWS costs. Why? Because the way it's done now is a pain. Stakeholders, especially engineers, are required to spend unnecessary time manually finding underutilized or overly expensive EC2s. We believe the optimization process should be done automatically through a series of sophisticated algorithms. At the moment, there are over 70,000 AWS EC2 prices - doing that manually just won't scale at most organizations. My background is in software engineering. Previous to founding Usage, I…


More commerce this month
the category →

Compare your startup equity grant for free.
Commerce · 26d ago · equitybee.com
Launched alongside, January 2026
the whole month →- IN
Hey HN! I wanted to share something I built over the last few weeks: isometric.nyc is a massive isometric pixel art map of NYC, built with nano banana and coding agents. I didn't write a single line of code. Of course no-code doesn't mean no-engineering. This project took a lot more manual labor than I'd hoped! I wrote a deep dive on the workflow and some thoughts about the future of AI coding and creativity: http://cannoneyed.com/projects/isometric-nyc
AI · Jan 2026 · cannoneyed.com




Automatic AI-powered code reviews the moment you open a PR
Dev tools · Jan 2026 · kilo.ai
