AWS Builder Center
How Kiro was used to build Ministack

How Kiro was used to build Ministack

A short story of how Ministack was born.

MSc in AI and Big Data - MSc in Quantum Tech (ongoing)

The day LocalStack went paid

Nobody wakes up and thinks "It could be nice to build another cloud emulator from scratch" but sometimes the tools you depend on are no longer open-source, and you have to make a call.
When LocalStack moved its core services behind a paid plan, we were using about 20 of them: S3, SQS, SNS, DynamoDB, Lambda, Step Functions, RDS, and a few more. They were wired into our CI pipelines, our integration test suites, our local dev loops. Losing them meant either paying up or finding an alternative.
We evaluated the alternatives. There were a few open-source projects trying to fill the gap, some only a less than a week old. We tried them but they had a backlog full of bugs: wrong response shapes, missing pagination, broken multi-tenancy, services that accepted requests and silently did nothing.
So I decided to build one.



The plan: deserialize AWS, not "guess" it

The first thing was to figure out how AWS actually works at the wire level. We didn't want to guess at request shapes or reverse-engineer responses by trial and error. We wanted a systematic source of truth.
AWS publishes service model files: JSON files that describe every operation, every input shape, every output shape, every error code, for every service. These are the same files botocore uses internally to generate its client code. We wrote a parser that ingested those models and gave us a complete map of what each service was supposed to accept and return. That became our skeleton, the contract we were building toward.
From there we pulled all the AWS documentation. Every service page, every API reference, every behavioral note about pagination tokens, error codes, and edge cases. We fed that into a RAG pipeline so we could query it during development. Instead of tabbing between browser windows trying to find the right page, we could ask "what does DynamoDB return when a conditional check fails with ReturnValuesOnConditionCheckFailure set?" and get the answer in context. We also set up a daily job that checks the AWS docs and botocore model files for updates: new operations, changed shapes, new services, so we don't drift.
That combination of deserialized API contracts plus queryable documentation meant we were always building against the real spec, not our memory of it.



TDD by Kiro wrote the tests first

Here's where the workflow got interesting. I used Kiro as the primary development tool throughout the entire build.
The pattern we settled into: Kiro reads the API model for a service, reads the relevant documentation from the RAG, and writes the test suite first. Not stubs. Actual tests that assert the correct response shapes, the correct error codes, the correct pagination behavior, the correct multi-tenancy isolation. Tests that would fail against a blank implementation and pass only when the service was actually correct.
This was the right order. Writing tests from the spec before writing any implementation code meant we had a precise, executable definition of "done" for every service. It also meant that when we later found a bug (wrong HTTP status code, missing field in a response, broken error shape) we could add a regression test and know exactly what we were fixing.
Once the tests existed, we used Claude to build the implementations. The loop was tight: tests fail, Claude writes the service handler, tests pass, move on. For services with complex behavior like the Step Functions ASL interpreter, DynamoDB conditional expressions, or EventBridge content filtering, this took several iterations (and a lot of help from the Ministack community).



What "correct" actually means

One thing we learned quickly: AWS has a lot of subtle behavior that nobody documents explicitly. You only find it when your SDK breaks.
Query-protocol services (SQS, SNS, RDS, ElastiCache) must return HTTP 400 for every client error, including not-found errors. Not 404. 400. The Java SDK v2 and Go SDK v2 do strict error mapping based on HTTP status. If you return 404, they surface a generic  SdkClientException  instead of the typed exception your code is catching. We had to audit around 70 call sites across 4 services to fix that.
Timestamp fields are another one. Some services return timestamps as ISO-8601 strings. Some return them as integer epoch seconds. Some return them as float epoch. The rule isn't consistent across services; it's consistent within a service, and you have to read the wire format carefully. Get it wrong and the Go SDK rejects your response with a parse error.
Pagination tokens are supposed to be opaque. AWS doesn't document what's inside them, and SDKs don't inspect them; they just pass them back. But if your token is a raw integer offset, a determined user (or a Terraform provider doing a plan/apply cycle) can figure out the pattern and break when you change it. We had to go through every service and replace integer offsets with base64-encoded or HMAC-signed tokens.
None of this is in the documentation. You find it by running real SDKs against your emulator and watching them fail.



The architecture: one port, a lot of (more than 60 now) services

MiniStack runs on a single port (4566 by default) and routes every request to the right service handler. AWS uses a mix of routing signals: the  X-Amz-Target  header for JSON-protocol services, the  Action  query parameter for Query-protocol services, the URL path for REST services, the  Host  header for virtual-hosted S3 and API Gateway execute endpoints.
The router reads all of those signals and dispatches to the right module. Service modules are loaded lazily; they're not imported until the first request for that service arrives. This keeps startup time under 2 seconds.
For services that need real infrastructure (RDS, ElastiCache, ECS, Lambda container images) we spin up actual Docker containers. RDS gives you a real Postgres or MySQL instance. ElastiCache gives you a real Redis. MWAA runs in real ApacheAirflow. ECS runs your actual task containers. Lambda with  provided.al2023  runs your Go or Rust function via the Lambda Runtime Interface Emulator. The emulator handles the control plane; real software handles the data plane.
Multi-tenancy works through the access key. If your  AWS_ACCESS_KEY_ID  is a 12-digit number, MiniStack uses it as the account ID. Every resource (every ARN, every queue, every table, every function) is scoped to that account. Two developers sharing a single MiniStack endpoint get completely isolated environments with no configuration.



Johannes joined, and things moved faster

The core was built by a small team up to ~v1.1.0. At that point Johannes came on board, and his focus was less about writing service handlers and more about giving the project shape at the organisation level: closing gaps faster, bringing in new services, setting up the multi-repo structure, making it easier for contributors to land PRs without things breaking. The kind of work that doesn't show up in a single commit but makes everything else possible.
That split worked well. The core implementation kept moving; Johannes kept the project from collapsing under its own weight as it grew. And contributors started showing up, fixing edge cases, adding missing operations, reporting SDK incompatibilities from languages and frameworks we hadn't tested against.

Where we are now

We started with 20 services. We're at 60+ now, with a changelog that's grown to hundreds of entries. Every week there are new contributions: missing operations, wrong error shapes, broken SDK compatibility, new services.
The daily doc-sync job has caught several AWS API changes before they would have broken anything. New operations get flagged, changed shapes get noted, new services get added to the backlog.
The RAG is still running. When a contributor opens a PR for a service we haven't touched in a while, we can pull the current AWS documentation into context and review the implementation against the spec without leaving the editor.
And Kiro is still the primary IDE. New services follow the same pattern: read the model, read the docs, write the tests, implement against the tests. It's not glamorous, but it's the reason the thing actually works.



Why we open-sourced it

We built this because we needed it. We open-sourced it because everyone else needed it too.... Use it and like it, great. Don't, no hard feelings 💔
The main tool going paid wasn't just our problem. It was every team running AWS workloads locally, every CI pipeline that needed a real SQS queue to test against, every developer who didn't want to pay for an AWS account just to run their test suite. MiniStack is MIT licensed and free forever. We don't ask for support or sponsorship. That's not a marketing line; it's the point.
If you're using it, or you find a bug, or you want to add a service, or a comment:  github.com/ministackorg/ministack .
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article