Building a graveyard for forgotten AWS resources with Kiro

2026-11-28来源 dev.toEnglish

This post is written as part of the Kiroween 2026 hackathon.

I run a one-person software studio in Korea, and this project was built with Kiro. Kiro wrote most of the code, other AI tools did the reviews, and some fixes were made outside Kiro. The decisions were mine: the topic, spending no extra money on it, reviewing until nothing blocking or important was left, what to do when a review left a choice open, when to re-record the demo video (I watched it and found a click that did not match), and keeping the project in its Korean-named folder. In this post, "we" means me and those tools. We did not start from a single bad bill. We started by talking through what small teams on AWS actually struggle with, and one topic kept coming back: small accounts leak money quietly. A volume from a test or an Elastic IP nobody released costs a few dollars a month, a forgotten NAT gateway costs more, and they sit in regions nobody opens. We agreed that was worth building for.

So for Kiroween we built ZombieScope. It scans an AWS account (read-only), finds resources that nobody uses but that still cost money, and shows them as tombstones in a haunted graveyard. A bigger stone costs more. Click one and the "coroner" tells you why it is probably dead, what could go wrong if you delete it, and gives you a cleanup script to review. ZombieScope never runs that script for you.

Repository: https://github.com/JuneBay/zombiescope | Live demo (no AWS account needed): https://junebay.github.io/zombiescope/ | Video: https://youtu.be/Eh8KC1pEqnk

Steering before the first line of code

The first thing written, outside Kiro, was not a prompt. It was three steering files: product, tech and structure. They say, for example, that the scanner makes only Describe, List and Get calls, that credentials never leave the user's machine, that demo data is synthetic, and that every cost is labelled as an estimate. All three are marked inclusion: always. Setting the rules once at the start gave every run the same base rules. The more work I hand to an AI, the more important I feel it is to write down first what it must not do.

Specs, then tasks

Kiro wrote a spec for each half from those steering documents and one prompt per half: the scanner spec in vibe mode, the web app spec in spec mode. The scanner spec now has 21 requirements, 11 correctness properties and 27 tasks. The web app spec has 20 requirements, 13 properties and 15 tasks. In our runs, spec mode used more credits than a plain prompt and gave a more detailed task plan.

The correctness properties became tests, most of them property-based: Hypothesis in Python and fast-check in TypeScript. For example, a redacted ID never contains the raw ID (for IDs of 13 to 32 hex characters), and a bigger volume never costs less. Today the scanner has 609 tests and the web app 191.

Driving Kiro CLI from a script

We drove Kiro CLI through the Agent Client Protocol from a small Python script. That let us log every run (57 so far, all in docs/kiro-usage-log.md), choose the model per task, and put guards around the agent. From run 30 on, it had only dummy AWS credentials and any shell command that starts the AWS CLI was refused; before that, AWS CLI commands that delete, stop, modify or detach resources were refused.

Kiro also wrote two custom agent files, a builder and a "done-claim auditor". The run logs show that the CLI did not load them: every run that asked for one got agent/not_found and fell back to the default agent. The files are in the repo, but we do not claim the agents ran. Their rule was applied from the outside instead: throughout the project, reviews checked tasks marked done against their files and tests, and tasks found not done were unmarked.

The bugs that taught us something

The mistakes were more useful than the successes, so we kept all of them in the log.

  1. Prices that looked right. An early run priced load balancers with the per-LCU rate as if it were the hourly rate. Nothing looked strange. Now every price table is generated from the public AWS Price List by a script, with known-value tests.
  2. "Done" that was not done. One run marked the CLI task complete while the CLI was still a stub. Another time, on a Windows path with Korean characters, Kiro re-typed the folder name with one syllable changed, wrote its files into a new folder, and then, with its work apparently lost, deleted tests and marked tasks done. Working through an ASCII link to the same folder fixed the first part. Checking every "done" against the files caught the rest.
  3. The metric name. From the first version, the NAT gateway check asked CloudWatch for a metric name that does not exist. A busy NAT gateway could have read as zero bytes and been called a zombie. The tests used moto, and moto accepts any metric name, so twelve review rounds and every test missed it. It was found by comparing the code with the AWS metric table. Since then, the NAT gateway request (metric name, namespace and dimension) is tested against the AWS metric table, not only against the mock.
  4. Cleanup is harder than detection. Several review findings were about what happens when someone runs the plan. A load balancer whose targets are all unhealthy still routes traffic, so it is not a zombie. A volume shared by two instances must not be deleted by either plan. A snapshot must finish before the instance is terminated.
  5. Fixes that add words add risk. Three review rounds in a row found their main problem in a sentence written in the round before. After that, fixes were asked to remove words rather than add them.

Three things stayed with me. With the metric name, every test passed and twelve review rounds went by, and one wrong name was still there. I learned that passing tests does not mean the code is right. Second, in 5 of the 57 Kiro runs a task was marked done when it was not. After that, we kept running reviews until nothing blocking or important was left to fix. Third, the folder path. Korean developers like me often keep their work in folders with Korean names, and that kept causing problems here: under such a path, Kiro's file writes failed silently and it wrote 23 files into a misspelled folder, and later the web build itself failed on the same path. We could have moved everything to an English path on day one. We kept the project where a Korean developer would keep it, because other Korean users, and anyone whose folders are not named in English, can hit the same problems. Kiro worked through an ASCII link to the same folder, the deploy build runs from an ASCII copy, and these failures went into the log.

Reviews

Kiro's work was reviewed between runs by other AI tools. The repository was checked against the AWS documentation, and the cleanup plans were tested without a real AWS account. Findings were checked against the files before they were fixed, and the reviews continued until nothing blocking or important was left.

The spooky part

The category I entered is Costume Contest, so the graveyard had to look the part and still be easy to use. Spooky names have a plain label next to them ("Exorcism plan (cleanup script)"), and there are switches for reduced motion and sound. One themed alert panel let the moon show through and dropped the text contrast to 1.06:1. We measured the rendered pixels, fixed it and measured again: 12.81:1.

What we would do again on day one

  1. Write the steering files before the first prompt.
  2. Do not type numbers by hand. Generate them and test them.
  3. A mock that accepts anything will agree with your bug.
  4. Check every "done", from a model or from a person.

Looking back over dozens of review rounds, the same five problems kept coming back. Korean folder paths broke file writes and later the build. Cleanup plans kept needing fixes: a missing snapshot, a missing wait, or a missing cost line can lose someone's data or money. The text kept drifting away from the code, and three times in a row a fix's new words caused the next problem. Tests passed while the code was wrong. And "done" was not always done. Each of these came back at least once after we thought it was fixed.

ZombieScope is open source under the MIT license, and you can try the demo graveyard without an AWS account. This post was written for the Kiroween 2026 hackathon.

原文:https://www.a8q9.cn/en/article/building-a-graveyard-for-forgotten-aws-resources-with-kiro-6e8168.html

相关文章