Local AWS Emulation: A Stack Roundup for Coding Agents and the Humans Who Review Them
There's a failure mode that shows up the moment you hand a coding agent an AWS SDK and a shell. It writes a plausible handler, runs it, gets InvalidClientTokenId, and starts "fixing" the code. Ten minutes later you're reviewing a rewrite of logic that was fine, produced by an agent that was actually fighting a missing credential rather than a broken function.
The bottleneck was never the code. It was the feedback loop.
That's the context for AWS's newest entry into local testing: an emulator that ships as a local HTTPS endpoint, generated from public Smithy API models, covering 200+ services, with no AWS account required. The headline feature isn't the service count — it's that AWS publishes fidelity scores per service, alongside documented limits around IAM, regions, and in-memory state.
Publishing fidelity scores is an admission. Most emulators ask you to trust them; this one tells you where it's lying. That's far more useful, because it turns "should I emulate this?" from a vibe into a decision you can write down.
Here's the stack we actually reach for, when each piece wins, when each one will quietly mislead you, and where the pricing gets slippery.

Figure: Editorial context image from the source page (preview only; rights remain with the publisher) · Credit / further reading: www.infoq.com
The lineup
AWS Emulator — default for "does this code even compile against the API"
Use it for: SDK call-shape validation, IaC dry runs, agent-in-the-loop iteration, and teaching an agent which parameters are required versus optional. Because it's generated from Smithy models, the request/response shapes track the real API more closely than hand-maintained mocks, and the "no account" property means a fresh container is a fresh sandbox.
Don't use it for: IAM policy evaluation, cross-account flows, anything region-pinned in a meaningful way, or state you expect to survive a restart. The documented limits are exactly the three things teams assume are free: identity, geography, and persistence.
The trap: in-memory state means restart equals empty world. Perfect for contract tests, catastrophic if your suite assumes seeded fixtures persist between runs. Similarly, a test that "proves" your least-privilege policy works against a limited IAM implementation proves nothing. You've validated your policy against a mock of a policy engine.
LocalStack — default for "I need a running environment"
Use it for: integration tests that span services — SQS triggering Lambda writing to DynamoDB, CDK or CloudFormation deploys into a fake account, persistent local dev environments, and anything where you need the resources to still exist tomorrow.
Don't use it for: free-tier purity. The community edition covers a slice; the services that make integration tests interesting sit behind a paid plan. And don't use it when you need exact parity — you'll get 90% and spend a week on the other 10%.
The trap: services outside your tier degrade to stubs or hard errors, and it's not always obvious which until the test fails in a confusing way. Boot time and memory footprint also matter on shared CI runners; a 2 GB emulator container across 400 daily builds is a real line item.
Moto — default for Python unit tests
Decorator-based, in-process, no container, milliseconds to start. Excellent at asserting "my handler calls put_item with these arguments and handles ConditionalCheckFailedException." Bad at being a service — no networking, no real concurrency, and coverage is uneven across the long tail.
Service-specific emulators — DynamoDB Local, ElasticMQ, Step Functions Local
When one service is 80% of your surface area, a focused emulator often beats the general-purpose one on fidelity. DynamoDB Local in particular is the reference implementation of "good enough that people forget it's an emulator." ElasticMQ nails the SQS semantics that matter (visibility timeouts, DLQs) without pretending to be the rest of AWS.
A real sandbox account — the only thing that tests IAM
Budget-gated, teardown-automated, never pointed at production. This is the last mile and no emulator replaces it.
| Tool | Best at | Fidelity risk | Cost shape |
|---|---|---|---|
| AWS Emulator | API shapes, agent loops | IAM, regions, persistence | Free; container + tokens |
| LocalStack | Multi-service integration | Tier-gated services | Per-seat / per-CI |
| Moto | Fast Python unit tests | Concurrency, long tail | Free |
| DynamoDB Local / ElasticMQ | Single-service depth | Everything else | Free |
| Sandbox account | IAM, quotas, cost behavior | None | Real spend |
When to emulate at all
A rule that has held up: emulate the contract, verify the semantics against the real thing.
- Agent loops: emulator, always. Fast, offline, deterministic, free, and no risk of an agent deciding to "clean up" a real account.
- PR CI: emulator for unit and contract tests, plus one narrow job against a real sandbox for the money path — auth, billing-adjacent writes, anything irreversible.
- Pre-prod: real AWS, always.
If a test can't fail in a way that matters, delete it rather than emulating it.
When not to emulate
- IAM. Policy evaluation is a graph problem: identity policies, resource policies, permission boundaries, SCPs, condition keys, session tags. No emulator gets all of it right, and the honest ones publish a low score for exactly this reason. IAM belongs in a sandbox account with real
sts:AssumeRolecalls. - Cross-account and cross-region. Emulators are usually single-tenant single-region by design.
- Managed control planes. RDS, EKS, OpenSearch — you're testing the mock's config parser, not the service.
- Cost-sensitive behavior. Budgets, anomaly detection, Savings Plans, and Spot interruption have no meaningful local equivalent.
- Throttling and quotas. If your retry logic depends on real rate limits, an emulator that never throttles is testing the happy path and calling it resilience.

Figure: HEXOPS original illustration inspired by the topic (not a copy of the source article imagery) · Credit / further reading: www.infoq.com
Pricing caveats worth writing down
1. "Free" is not free. Container CPU, CI minutes, and — with agents — tokens. A flaky emulator that sends an agent into a retry loop burns more money than the sandbox account it was supposed to replace. Measure the loop, not the license.
2. Seat-based emulator pricing scales badly. Run the math on a team of 40 before you standardize on a paid tier. Per-CI-run pricing is usually the better fit if humans rarely use it locally.
3. Sandbox accounts leak. Forgotten NAT gateways, idle RDS instances, orphaned EBS volumes from failed teardowns. Budget alarms plus a nightly nuke job, or you'll discover the leak on the invoice.
4. Divergence is a maintenance cost. Every service you emulate is a service whose divergence from reality you now own. Fidelity scores help — pin the version you validated against and re-read your assumptions when it bumps.
5. The false-negative tax. A test that fails on the emulator but is correct costs an engineer an afternoon of debugging nothing. It's invisible on a spreadsheet and it's the single biggest reason teams abandon local emulation.
The fidelity score is the contract. Treat it like one: record which version you built assumptions on, and when it changes, don't assume your green build means what it meant last week.
Sources
- InfoQ — AWS Open-Sources Emulator for Local Testing of 200+ Services by Coding Agents (Daniel Dominguez): https://www.infoq.com/news/2026/11/aws-emulator-agents/
- LocalStack documentation and pricing: https://localstack.cloud/
- Moto (Python AWS mocks): https://github.com/getmoto/moto
- DynamoDB Local: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html
- ElasticMQ: https://github.com/softwaremill/elasticmq
- AWS Testcontainers modules: https://java.testcontainers.org/modules/aws/



