AWS Emulator vs Real AWS: 146 Steps, 17 Differences
I ran the same 146 API steps against AWS Emulator and real AWS. 129 matched. The 17 that didn't include a permissions boundary the emulator ignores.
Cloud Engineer
A developer changes a role so it can only read from one S3 prefix, adds a permissions boundary as a second guard, and runs the integration tests against AWS Emulator. Everything passes. In my test, that boundary was ignored: a role the boundary limited to
GetObject could still PutObject on the emulator, and real AWS returned AccessDenied .I ran the same 146 API steps against AWS Emulator v1.0.385 and against my real AWS account, treating real AWS as the answer key. 129 steps matched. 17 didn't. This post covers all 17, plus two places where the emulator did better than its own documentation says.
What I ran
AWS released the emulator on November 11, 2026. It's a local program that answers AWS API calls on
https://127.0.0.1:9297 , keeps everything in memory, and needs no account. The code is CC0.I installed it without
sudo : downloaded the RPM, checked the GPG signature against the fingerprint in the docs, and extracted it into my home directory. Telemetry is on by default, so I started it with --telemetry off .The setup has one trap. If
AWS_ENDPOINT_URL isn't set, your SDK quietly calls real AWS with whatever credentials it finds. So the environment script unsets every credential variable, and the test harness refuses to run unless sts get-caller-identity returns account 000000000000 , which is the emulator's fixed account ID.$ aws sts get-caller-identity{ "UserId": "AIDAH5I7GEMO7ADXNFAZU", "Account": "000000000000", "Arn": "arn:aws:iam::000000000000:user/emulator"}
The test
One Python script, two backends. Each step makes an API call and records the outcome: success or error code, HTTP status, error message, the response's top-level keys, and a few values I chose per step. The script normalizes account IDs, UUIDs, timestamps, and resource names, then a second script diffs the two result files.
The 146 steps cover seven services:
Service | Steps | What I tried |
|---|---|---|
KMS | 17 | encrypt/decrypt round trip, wrong encryption context, disabled keys, bad aliases |
S3 | 23 | ranges, conditional writes, versioning, delete markers, SSE-KMS |
DynamoDB | 24 | condition failures, 400 KB item limit, transactions, number precision |
SQS | 20 | FIFO dedup, batch limits, purge, visibility timeout |
IAM | 12 | malformed trust and permission policies, delete conflicts |
IAM enforcement | 20 | roles with narrow policies, then harder cases |
Lambda | 16 | create, invoke, handler errors, config updates |
EventBridge | 14 | pattern matching, put_events , delivery to SQS |
Many steps are deliberate failures, since error behavior is where emulators tend to drift. On the real side I created short-lived resources in us-east-1 and deleted them at the end, then swept the account for leftovers. The only things remaining are six test KMS keys in the 7-day deletion window.
What matched
S3 matched on all 23 steps, including conditional writes (
If-None-Match: * returns PreconditionFailed on the second write), the NoSuchKey message, and BucketNotEmpty . DynamoDB matched on 23 of 24, including the transaction cancellation reasons and the 400 KB limit.The result I trusted least going in was EventBridge delivery to SQS. On real AWS, a rule targeting a queue delivers nothing until the queue has a policy that lets
events.amazonaws.com send to it. I sent one event before adding the policy and one after. Real AWS: not delivered, then delivered. Emulator: not delivered, then delivered.The IAM docs undersell the emulator
The documentation says the emulator doesn't check S3 bucket policies and doesn't evaluate IAM "the same way as AWS". The press coverage reads that as "no IAM".
In my run it enforced these cases the same way real AWS did:
- a role with no policy at all
- a narrow identity policy (allow
GetObjectundera/*only)
- an explicit
Denyon a prefix
- a bucket policy denying one role on one prefix
- a
ListBucketallowed only when thes3:prefixcondition matches
- a session policy passed to
AssumeRole
- the trap from my IAM Policy Autopilot demo:
PutObjectwithaws:kmsencryption on a role that hass3:PutObjectbut notkms:GenerateDataKey
That last one produced the same denial on both sides, with the same missing action named in the message. The emulator's version stops before the console link AWS appends.
The docs say "a request that AWS denies might succeed in the emulator". They're correct, and the next section shows where.
Where it accepts what AWS rejects
Permissions boundaries are ignored. I attached a boundary allowing only
s3:GetObject to a role whose identity policy allows s3:* . PutObject succeeded on the emulator. Real AWS returned:User: arn:aws:sts::<acct>:assumed-role/<run>-e2bnd/fid2 is not authorized to perform:s3:PutObject on resource: "arn:aws:s3:::<run>-bkt/a/bnd.txt"because no permissions boundary allows the s3:PutObject actionIAM accepts malformed policies. An inline policy with the action
not-an-action , and another with no Resource , both returned MalformedPolicyDocument on AWS and succeeded on the emulator. It also let me attach a managed policy ARN that doesn't exist (AWS: NoSuchEntity ), and SimulatePrincipalPolicy returns NotImplemented .Lambda accepts a function whose role doesn't exist.
create_function with a made-up role ARN succeeded locally. AWS: InvalidParameterValueException , "The role defined for the function cannot be assumed by Lambda."These share a pattern: the emulator is lenient where validation depends on other resources existing. A test suite that passes locally can still fail the first time it runs on AWS.
Where it's stricter
put_events with a missing Source returns HTTP 200 on AWS, with FailedEntryCount set and a per-entry error. The emulator raises ValidationException for the whole call. Code that checks FailedEntryCount never runs its failure path locally, and code that catches the exception behaves differently on AWS.Timing: the emulator has no eventual consistency
IAM on real AWS is eventually consistent, and the emulator isn't. I created a role and, a few seconds later, referenced it as a bucket policy principal. AWS answered
Invalid principal in policy , and I had to retry until the role propagated. The emulator accepted it on the first attempt.Lambda showed the same thing from the other side. Right after
update_function_configuration , an invoke on AWS still returned the old environment value ( hi ). The emulator returned the new one ( yo ). Neither is wrong, but a test that passes locally because everything is instant can flake on AWS.The cosmetic differences
Eight steps differed only in message text or response shape. Examples: the KMS deletion-window error has an empty message on the emulator ("PendingWindowInDays must be between 7 and 30" on AWS),
get_object on a versioned bucket omits VersionId , a Lambda DryRun invoke adds an ExecutedVersion key, and the emulator's list of valid runtimes includes retired ones like python2.7 . If your code matches on error message text, these will matter. If it matches on error codes, they won't.Speed
The emulator's 146 steps took 34.5 seconds of API time. The same steps on AWS took 142.3. DynamoDB dominated the emulator's total at 23.2 seconds, which is table creation and deletion waiting. Everything else on the emulator finished in about 11 seconds across the other services.
What I got wrong
My first harness version silently dropped the result value for any step that returned a plain dictionary, so the EventBridge delivery steps and the FIFO dedup steps compared as identical without recording anything. 118 of 133 steps "matching" looked fine until I noticed that the two most interesting steps had no data. I fixed the recorder and reran everything on both sides. If a result looks too clean, check that it recorded anything.
I also expected the IAM test to be the emulator's clearest failure, because the press coverage said it doesn't evaluate policies. It was the opposite, and I built the second IAM group (permissions boundary, session policy, conditions) only after the first one surprised me.
What this doesn't tell you
- 146 steps is a sample. The emulator's own scorecard lists tens of thousands of tests, and its pass rate at launch was 56.5%. My steps are common paths on popular services, so a high match rate here says nothing about the long tail.
- One run per backend. I didn't repeat runs to check for flakiness.
- One Region. I used us-east-1. AWS says it verifies the emulator against us-west-2.
- KMS key policies, cross-account access, and resource-policy behavior beyond S3 and SQS were not tested.
- This is v1.0.385. AI agents update the emulator many times a day, so these results will age.
- I tested IAM enforcement for S3 requests. The emulator may behave differently on other services.
What I'd do with it
Use it for the loop where speed matters: SDK calls, serialization, conditional writes, FIFO behavior, and error codes. Keep one stage on real AWS for anything that depends on IAM details. The permissions boundary result is the reason: a test that passes on the emulator proves your code runs, not that your permissions are right.
Cost and cleanup
Everything on the real side was on-demand and short-lived: S3 buckets, a DynamoDB table, SQS queues, Lambda functions, an EventBridge bus, IAM roles, and six KMS keys. Cost Explorer for November 15 shows about $0.18 across the services involved: $0.17 for KMS (prorated key-days), under a cent for Lambda, and a fraction of a cent for S3. DynamoDB, SQS, EventBridge, and IAM billed nothing. After each run I swept the account for anything starting with the test prefix. The only leftovers are the six KMS keys, scheduled for deletion on November 22.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article