AWS Builder Center
AWS Emulator and Kubernetes: a local development loop for a microservice app on AWS

AWS Emulator and Kubernetes: a local development loop for a microservice app on AWS

Kubernetes from kind, AWS from AWS Emulator: a fully observable local dev loop for microservices, no AWS account needed.

Yesterday I ran a  12-service serverless app on my laptopwith AWS Emulator and traced every order in Grafana . The obvious next question was containers. A lot of the teams I talk to run their services on Amazon EKS, and their services call DynamoDB, SQS, SNS, EventBridge and S3 all day long. Could the emulator give those teams the same fast local loop?
I'll answer the question I had to answer first, because it shapes everything else in this post: AWS Emulator answers the EKS API, but it does not run Kubernetes. You can create a cluster, a node group, add-ons and access entries, and you get AWS-shaped responses and AWS-shaped validation errors back. There is no control plane, no nodes and no pods behind them.
So I didn't build "EKS on my laptop." I built something more useful: a local development loop for a Kubernetes microservice app on AWS. Kubernetes comes from kind, the AWS services come from the emulator, and everything is observable with OpenTelemetry and the Grafana LGTM stack running in the same cluster. The EKS API shows up in one place where it actually earns its keep.
This post covers what the emulator does for EKS (with the probe results), what I built, what changed compared with the serverless version, the lessons I learned, and a full user journey with screenshots, including four failure scenarios I broke on purpose.

What the emulator does for EKS

Before writing any app code, I started a throwaway emulator on a spare port and pointed the AWS CLI at it. Here's what I found on version 1.0.322.
What works (the AWS API side):
  •  CreateCluster  validates input the way AWS does. With one subnet it fails with  InvalidParameterException: resourcesVpcConfig.subnetIds must specify at least 2 subnets .
  • With two subnets the cluster reaches  ACTIVE  in under 5 seconds and comes back with an endpoint, CA data and an OIDC issuer.
  • Node groups, Fargate profiles, access entries, Pod Identity associations and add-ons all create, list and describe.  describe-addon-versions  returns real version data, and  eks get-token  returns a properly shaped token.
  • ECR creates repositories and auth tokens.
What doesn't run:
  • The cluster endpoint is a  *.eks.amazonaws.com  hostname with no Kubernetes API server behind it.  kubectl  has nothing to talk to.
  • A node group reaches  ACTIVE , but  ec2 describe-instances  stays empty.
  • ECS  RunTask  returns a task, and  ListTasks  returns nothing right after. No container starts.
That result changed my plan, and I'm glad I probed first. If your goal is to test Kubernetes manifests or Helm charts, kind or k3d already do that well. The emulator's value for a containerized app is somewhere else: the AWS services your pods call.

So who is the EKS API for?

It helps code whose job is to call the EKS API:
  • Platform and self-service tooling. A portal that creates clusters, a pipeline step that waits for a node group, a script that manages access entries. You can test the logic, the waiters and the error handling without paying for a cluster or waiting 15 minutes for one.
  • Inventory, compliance and cost tools. Something that lists clusters, add-on versions or node group sizes and flags drift can run against seeded clusters in CI.
  • Coding agents that are learning to provision EKS and need somewhere safe to fail.
I wrote a small tool like that for this project, and the emulator surprised me more than once. More on that below.

What I built

Same store as yesterday, AnyCompany Retail, same order flow. This time it runs as 10 TypeScript services on Kubernetes:
  • storefront: HTMX and Tailwind UI.
  • orders-api: writes the order to DynamoDB and publishes  OrderPlaced  to EventBridge.
  • fulfillment: the saga (reserve stock, authorize payment, confirm, request shipment), with compensation when payment fails.
  • inventory and payment: HTTP services the saga calls. Payment reads its gateway key from Secrets Manager.
  • shipping, notifier and analytics: SQS consumers.
  • ops: housekeeping and queue gauges.
  • loadgen: background traffic with a realistic mix of the six scenarios (happy path, declined card, slow gateway, flaky gateway, out of stock, undeliverable address).
My goals:
  • A real cluster, locally. kind with one control plane and two workers, one worker for the app and one for observability.
  • Real AWS APIs, locally. DynamoDB, SQS, SNS, EventBridge, S3, Secrets Manager and KMS, all from AWS Emulator.
  • Full observability. App traces, logs and metrics, plus the Kubernetes view: CPU against limits, CFS throttling, restarts and events.
  • Failure on purpose. Four Kubernetes-flavored faults I can start and undo with one command each.
  • Nothing reachable from outside my machine. Everything binds to  127.0.0.1 .

The overall architecture

Architecture: a kind cluster with the shop and observability namespaces, and AWS Emulator with the A

Here's the flow in plain words:
  1. The storefront calls orders-api over HTTP inside the cluster.
  1. orders-api writes the order to DynamoDB and puts  OrderPlaced  on an EventBridge bus.
  1. Two EventBridge rules route the event to SQS queues: one for the fulfillment saga, one for analytics.
  1. The saga calls inventory and payment over HTTP, confirms the order, and drops it on the shipping queue.
  1. Lifecycle events go EventBridge to SNS to SQS to the notifier, which "emails" the customer by writing to S3.
  1. Every service sends OTLP straight to the collector in the cluster. Two more collectors add the Kubernetes view.
The emulator runs as a container on kind's Docker network, so pods reach it by name at  https://aws-emulator:9297 . AWS doesn't publish an emulator image, so I built one from the short Dockerfile in the docs, using the binary I'd already installed.

The EKS API part

The one place this build uses the EKS API is a small tool called  cluster-registry . It's the kind of script a platform team writes: it keeps an "AWS view" of a cluster in step with the real one and reports drift. Here the real cluster is kind and the EKS API is the emulator.
It registers the cluster, a managed node group sized to the kind workers, an add-on and an access entry, waits for  ACTIVE  with the SDK waiters, and compares the node group's size with the real worker count. Its tests also prove the error handling against AWS's own validation errors.
Two behaviors made me grin, because they're exactly what would bite this tool on real EKS:
  • Add-on dependencies are modeled. My first run created the  adot  add-on and the waiter failed. The emulator had put it in  CREATE_FAILED  with a health issue: "cert-manager must be installed first." Installing  cert-manager  first fixed it, and the tool now replaces an add-on left in  CREATE_FAILED  by an earlier run.
  • Node group updates are asynchronous. My drift test changed the node group size and immediately checked for drift, and found none. Like EKS, the update goes through  UPDATING  and the new size appears only once the node group is  ACTIVE  again. The test now waits.
That's the whole pitch for the EKS API in one paragraph: my tool's logic, waiters and error handling got tested in about 3 seconds, without an account, and the emulator caught two mistakes I'd have made against the real thing.

What changed compared with the serverless build

This was the part I found most satisfying. Several workarounds from yesterday simply disappeared once the compute ran outside the emulator:
Serverless build
This build
Functions run on QuickJS with no sockets, so telemetry needed JSON log lines and a bridge process
Pods export OTLP to the collector directly. No bridge
 BatchGetItem  returned no items inside a function
Works from a pod. orders-api uses it
At most 256 AWS SDK calls per invocation
No limit
Step Functions keeps at most 64 MiB of executions, so I rotated two state machines
The saga is code in the fulfillment service
EventBridge Scheduler never fires
Housekeeping is a loop in the ops Deployment
API Gateway to Lambda passed 41% of fidelity tests
Not used. Services call each other over HTTP
The telemetry story got much simpler. One order is one trace across 8 services and 36 spans, including the EventBridge, SNS and SQS hops. Every message carries a W3C trace context in its body, and each consumer starts its processing span with that context as the parent.

Lessons I learned

Emulator lessons

What I hit
What I did about it
The emulator's TLS certificate names only  localhost ,  127.0.0.1  and  ::1 , but pods call  aws-emulator 
The AWS SDK in each pod uses an HTTPS agent that trusts the emulator's CA (mounted from a ConfigMap) and checks the certificate against the name  localhost . Verification stays on
The emulator makes new SigV4 keys every time it starts
A script copies the keys and CA into the cluster after each start, and  up.sh  restarts the Deployments
Pod Identity and IRSA can't hand credentials to real pods
The emulator keys come from a Kubernetes Secret
The SQS client follows the queue URL host, which is real AWS
Every SQS client sets  useQueueUrlAsEndpoint: false  (same as yesterday)
S3 keeps at most 1,000 objects per bucket
The ops service keeps the newest 500

Kubernetes lessons

None of these are emulator issues, and that's the point. A fast local loop let me find them in minutes:
  • Rollouts broke keep-alive callers. After every rollout, the storefront logged a few  fetch failed  errors: it reused connections to pods that were shutting down. A 5-second  preStop  sleep, closing idle sockets on SIGTERM, and a short drain for in-flight requests brought that to zero.
  •  rollout status  returns while old pods still serve. A terminating pod keeps answering on connections it already holds. My fault scripts wait until every pod of the Deployment is current before declaring a fault active.
  • A SIGTERM mid-saga stranded an order. One order stopped between "confirm" and "request shipment", and the redelivered message was then ignored because the order wasn't  PENDING  anymore. Consumers now drain in-flight messages on shutdown, and a redelivered  CONFIRMED  order resumes at "request shipment."
  • A filtered  Scan  stopped finding products. Once orders filled the table, the first 1 MB page held no products, so the filtered list came back empty and stock was never restocked. Real DynamoDB behaves the same way. Products now live under their own key in the GSI and are listed with a  Query .

Observability lessons

  • OTLP-ingested gauges don't go stale for 5 minutes. A gauge from a deleted pod keeps its last value in Prometheus for 5 minutes, which confused my first verification runs.
  • Sampling the polling away. The UI polls every few seconds. A small root sampler drops those reads and their DynamoDB calls, so order traces are easy to find.
  • Grafana didn't pick up my ConfigMap updates. The kubelet swaps a symlink, and the provisioner missed it.  up.sh  now pushes the generated dashboards through Grafana's API instead of restarting the pod and losing telemetry.
One reminder from AWS that still applies: the emulator doesn't evaluate IAM the way AWS does. Test permissions on AWS.

The full user journey

Here's one session, captured with headless Chromium after the automated checks passed. The numbered callouts point at the parts I care about.

1. The storefront

Storefront with subtitle, scenario picker, place order button, background traffic and Grafana links

The page comes from a pod in kind (1). I pick a scenario (2) and place the order (3). The loadgen pod keeps background traffic flowing (4), and the header links straight to the dashboards (5).

2. The order is accepted, then ships

Order accepted banner with order id and trace link

The banner shows the order ID orders-api just wrote to DynamoDB (1), and a deep link to this order's trace in Tempo (2).
Order detail with status timeline and tracking id

Less than a second later the timeline reads  PENDING ,  PROCESSING ,  CONFIRMED ,  SHIPPED  (1), and the shipping worker has added a tracking ID (2).

3. One order, one trace

op of the happy-path trace with callouts on the root span, pod-to-pod HTTP, AWS SDK spans, EventBrid

This is my favorite frame. The trace starts with the click in the storefront pod (1). Pod-to-pod HTTP carries the W3C trace context (2). The AWS SDK spans come from the real SDK in a pod, calling AWS Emulator (3).  OrderPlaced  goes to EventBridge with the trace context in its detail (4), and the same trace continues on the far side of the queue in the saga (5).
Bottom of the trace with the CPU-bound step, the shipping worker and the notifier

Further down, inventory's CPU-bound allocation step (1) is the target of one of my faults later. The shipping worker (2) and the notifier (3) sit in the same trace, parented across SQS, and across SNS and SQS.

4. A declined card and a flaky gateway

Declined trace with the gateway error and the compensation step

The gateway answers 402 and the span turns red (1). The saga's compensation step (2) calls inventory to release the reservation (3).
Retry trace with two payment attempts and a backoff span between them

The flaky gateway times out on the first attempt (1). The saga backs off for 500 ms (2), and the second attempt succeeds (3).

5. Every log line for one trace

Loki query by namespace and trace id returning logs from many pods

One Loki query filters by Kubernetes namespace and trace ID (1) and returns log lines from the orders-api (2), fulfillment (3) and shipping (4) pods, along with every other service that touched the order. Each line carries its pod, namespace and node.

6. The dashboards

I kept the same rule as yesterday: dashboards follow the workload, not individual services.
Order Path dashboard with business outcome, stuck orders and per-hop request rates

The Order Path dashboard leads with the business outcome (1). The "stuck orders" stat counts orders confirmed but not shipped (2), which becomes important in a minute. Below, every hop of the order path gets rate, p95 latency and errors from Tempo span metrics (3).
Cluster Health dashboard with throttling, CPU against limits and throttled periods

The Cluster Health dashboard is the Kubernetes view of the same pods: the most throttled container from cAdvisor (1), CPU used against limits from kubelet stats (2), and the share of 100 ms CFS periods each container spent at its limit (3).

Breaking it on purpose

Each fault starts with  npm run fault <name>  and goes away with  npm run restore <name> . The verification run starts each one, waits for its signal, and restores it.

F1: a bad rollout that crash-loops

I rolled out payment with a secret ID that doesn't exist. The new pod can't load its key and exits.
Cluster Health during the crash loop with restarts, BackOff events and the restart count

The new payment pod restarts again and again (1), the Kubernetes events collector picks up the  BackOff  events (2), and the restart count climbs (3).
Scenarios dashboard F1 row showing one available pod, the stdout error and no failed sagas

Then came my favorite surprise of the day. No orders failed. The rolling update kept the old payment pod serving (1). The new pod's last words show up from stdout through the filelog receiver (2), even though it died before its OpenTelemetry exporter could flush. And there are no extra failed sagas (3). The automated check placed an order during the crash loop, and it shipped. Detected in 25 seconds, with zero customer impact. That's Kubernetes doing its job, and the dashboards made it obvious.

F2: a CPU limit that's too tight

Kubernetes can now resize a pod's CPU in place. I used that to drop inventory's limit from 500m to 50m without a restart.
Scenarios dashboard F2 row showing throttling, reserve p95 and saga p95

Throttling jumps (1), the CPU-bound reservation step slows down (2), and the whole saga feels it (3). In the clean verification run, 29% of CFS periods were throttled and reserve p95 reached 925 ms, against about 25 ms for a typical reservation in a healthy trace, with zero restarts.

F3: a config change that points at the wrong table

I rolled out orders-api with a table name that doesn't exist. Health checks still pass, because the pod is fine. The data path isn't.
Storefront showing the order failure message

The customer sees the failure (1).
Span details for the failing DynamoDB call showing exception type, pod name and semantic-convention

The failing span names the problem directly:  exception.type ResourceNotFoundException , the emulator's error exactly as AWS returns it (1). The resource attributes show which pod made the call (2), and the AWS SDK instrumentation adds semantic-convention attributes for the operation (3). From "something is wrong" to "this pod, this table" in one click.

F4: a worker that's gone

I scaled shipping to zero replicas.
Scenarios dashboard F4 row showing shipping queue depth, stuck orders and shipments

Messages pile up on the shipping queue (1), the stuck-orders gauge rises with the age of the oldest one (2), and shipments drop to zero (3). After restore, the queue drained to 0 in about 30 seconds and the stuck orders went back to 0.

How I know it works

 npm run verify  checks the whole thing end to end:
  • 25 checks: loopback-only ports, nodes ready, emulator keys in sync, AWS resources, provisioning that changes nothing on a second run, EventBridge and SNS delivery, every Deployment available, resource limits on every container, order outcomes, one trace with no orphan spans, log correlation, Kubernetes metrics and events, every dashboard panel, the EKS tool's tests, all four faults, and no emulator limit warnings.
  • A clean  down , then  up  (186 seconds from nothing), then  verify  passed 25 of 25.
  • A 32-minute soak at 30 orders per minute had zero restarts and no emulator limit warnings. Emulator memory went from 195 MiB to 224 MiB as orders accumulated, until order retention kicked in.

Conclusion

I set out to see whether AWS Emulator could help a containerized team, and the answer turned out to be more interesting than "yes" or "no." The EKS API is for code that manages clusters, and for that it's sharp: it caught a missing add-on dependency and an asynchronous update in my tool within seconds. The bigger win is the inner loop for the services themselves. My pods called real AWS APIs with the real SDK, every order showed up as one trace across the cluster and its queues, and I could break things the way production breaks and watch the dashboards tell the story.
Moving the compute out of the emulator also removed most of yesterday's workarounds. No telemetry bridge, no execution store rotation, no call budget. What was left were real Kubernetes lessons about rollouts, shutdowns and DynamoDB pagination, and I'd much rather learn those on my laptop.
What I want to try next:
  • Push images to the emulator's ECR and have kind pull from it.
  • Point a coding agent at the cluster-registry tool and let it extend it against the emulator.
  • Run the same services on EKS against real AWS and compare the traces side by side.
If you run containers on AWS, try this split: Kubernetes from kind, AWS from the emulator, and OpenTelemetry across both. Start with one service and one queue, then keep going. I'd love to hear what you build.
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