Ministack: Free, open-source local AWS emulator - 60+ services, Terraform compatible, real databases. Free forever. MIT licensed.
Python awsaws-emulatoraws-localaws-sdkdevtoolsdockerdynamodbec2emulatorlambdalocalstacklocalstack-alternativeministackmock-awsopen-sourcepythons3sqsterraform
release v1.5.0 (#1480)
Nahuel Nucera98045d27c611
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0818d8e9..9b3c59a4 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,21 +7,28 @@ Versioning follows [Semantic Versioning](https://semver.org/).## [Unreleased]-### Fixed-- **IAM — a CloudFormation-provisioned policy no longer breaks the read APIs** — `AWS::IAM::Role` with `ManagedPolicyArns`, and both policy resource types, wrote records the IAM API never produced: `AttachedPolicies` held `{PolicyName, PolicyArn}` dicts where every reader expects a bare ARN, so `GetAccountAuthorizationDetails` and `ListAttachedRolePolicies` answered 500 (`unhashable type: 'dict'`) and `ListEntitiesForPolicy` never matched; and `Versions` was a list rather than a dict keyed by version id, so `GetPolicyVersion` and `ListPolicyVersions` failed on any policy a stack created. Policies and attachments now go through the IAM module itself, so one shape reaches every reader and `AttachmentCount` tracks stack-created attachments as it does API ones. `AWS::IAM::ManagedPolicy` also honours its documented `Roles`, `Users` and `Groups` properties, which it previously ignored, and both resource types return the attributes CloudFormation documents — the eight on `ManagedPolicy`, `Id` on `Policy` — instead of answering the physical id for every `Fn::GetAtt`. `Ref` on `AWS::IAM::Policy` returns the policy name, matching AWS. `GetAccountAuthorizationDetails` now also lists an attached policy whose document it cannot read, agreeing with `ListAttachedRolePolicies` rather than silently dropping the row. Reported by @iot-rocket.-- **Lambda — Node.js ESM handlers using top-level `await` load correctly** — the warm-worker and one-shot Node bootstraps `require()` the handler module and fall back to dynamic `import()` only on `ERR_REQUIRE_ESM`; a module whose graph contains a top-level `await` instead throws Node's `ERR_REQUIRE_ASYNC_MODULE` (since a synchronous `require()` can never wait on an async operation), which fell through to an uncaught `RuntimeError`. Both bootstraps now treat `ERR_REQUIRE_ASYNC_MODULE` the same as `ERR_REQUIRE_ESM`. This is AWS's own documented Lambda cold-start pattern (a module-scope `await` to force a client connection during Init, before the first invocation) and works unmodified on real Lambda already. Contributed by @ryan-bennett.-- **Cognito — `ListUsers` `Filter` matches values case-insensitively, except where AWS documents otherwise** — every filter comparison was an exact string match, so `email = "[email protected]"` missed a profile stored as `[email protected]` and a `^=` prefix search was equally literal. Values are now matched case-insensitively for `email`, `phone_number`, `name`, `given_name`, `family_name`, `preferred_username` and `sub`, while `username` and `status` stay case-sensitive as the `ListUsers` API reference specifies. Contributed by @ppettitau.-- **DynamoDB — an `UpdateExpression` alias is resolved before the key-attribute check** — `set #pk = :pk` with `#pk` mapped to a non-key attribute was refused with `Cannot update attribute pk. This attribute is part of the key`, because the check matched the key name as raw text inside the `#pk` alias and the `:pk` value reference. It now reads the alias-resolved attribute roots the update evaluator already reports, so only a path that resolves to the partition or sort key is rejected. Reported by @ppettitau.-- **RDS — `DescribeDBInstances` honors SDK `Filters`** — AWS Query clients serialize filters as `Filters.Filter.N` with `Values.Value.N`, but MiniStack only parsed its internal `Filters.member.N` form, so filters such as `db-cluster-id` were ignored and unrelated instances were returned. Both wire forms are now parsed with the existing AND-across-filters and OR-across-values semantics.+## [1.5.0] — 2026-08-23+### Added-- **CloudFront — SaaS Manager (multi-tenant distributions)** — connection groups (`CreateConnectionGroup`, `GetConnectionGroup`, `GetConnectionGroupByRoutingEndpoint`, `UpdateConnectionGroup`, `DeleteConnectionGroup`, `ListConnectionGroups`) and distribution tenants (`CreateDistributionTenant`, `GetDistributionTenant`, `GetDistributionTenantByDomain`, `UpdateDistributionTenant`, `DeleteDistributionTenant`, `ListDistributionTenants`, `ListDistributionTenantsByCustomization`) with ETag / `If-Match` optimistic concurrency, plus per-tenant WAF association (`AssociateDistributionTenantWebACL`, `DisassociateDistributionTenantWebACL`), tenant invalidations (`CreateInvalidationForDistributionTenant`, `GetInvalidationForDistributionTenant`, `ListInvalidationsForDistributionTenant`), domain tooling (`VerifyDnsConfiguration`, `GetManagedCertificateDetails`, `ListDomainConflicts`, `UpdateDomainAssociation`), and `ListDistributionsByConnectionMode`. `DistributionConfig` round-trips `ConnectionMode` / `TenantConfig` and `DistributionSummary` carries `ConnectionMode`; tenants require a `tenant-only` distribution (`InvalidAssociation`), CNAMEs are unique across tenants and distribution aliases (`CNAMEAlreadyExists`), a tenant created without a connection group lazily gets the account default group, deleting a distribution or connection group that still has tenants is refused (`ResourceInUse` / `CannotDeleteEntityWhileInUse`), and both new resource families are taggable (native CloudFront tagging and the Resource Groups Tagging API). MiniStack collapses async workflows: tenants and connection groups deploy, domains activate, DNS verifies, and managed certificates issue immediately.-- **EC2 — instances can have a real box behind them (`RegisterImage`)** — `RunInstances` returned a `running` record and booted nothing. `RegisterImage` now takes a container reference in `ImageLocation` and returns an `ami-` id; launching that id boots the image as a container whose IP becomes the instance's address, so `ssm:SendCommand` can report a real exit code. Such an AMI is `instance-store` backed: no EBS root volume, `StopInstances` / `StartInstances` answer `UnsupportedOperation`, and a container that dies reports `terminated`. Snapshot-backed registration is accepted as AWS accepts it and fails at `RunInstances` with `InvalidAMIID.Unavailable`, as does a reference that cannot be pulled. Registering is the only opt-in — with nothing registered EC2 never reaches for Docker. Reported by @iot-rocket.-- **SSM — Run Command** — `SendCommand`, `GetCommandInvocation`, `ListCommands` and `DescribeInstanceInformation` returned `InvalidAction`, so the standard instance health probe could not run. Invocations are asynchronous as on AWS: `SendCommand` answers `Pending` and the caller polls to a terminal state. `AWS-RunShellScript` runs in the instance's container, so `Status` is `Success` or `Failed` on the real exit code, with the script's output. An instance with no agent answering is refused with `InvalidInstanceId`. Contributed by @bandle.-- **EC2 — `RebootInstances` rejects unknown instance ids** — it returned `true` for any id. It now answers `InvalidInstanceID.NotFound`, matching AWS.+- **IAM — opt-in request authorization (`AUTH=true`)** — with `AUTH=true` MiniStack evaluates the caller's IAM policies before serving a request and answers `403 AccessDenied` (`User: {arn} is not authorized to perform: {action}`) when they do not allow it, across control-plane and data-plane paths (S3 object access, `execute-api:Invoke`, `lambda:InvokeFunctionUrl`, and per-service actions resolved from the botocore model). SigV4 signatures are still not validated — the access key only identifies the principal — so this is authorization, not authentication. Off by default (`AUTH=false`), leaving existing allow-all behavior unchanged.+- **Concurrency — a blocking handler no longer stalls concurrent requests** — the request-serving event loop is captured at startup and blocking service work runs on worker threads, with a helper that lets a worker thread re-enter an async handler safely; work is routed by whether it needs to call back into the server. Contributed by @Areson and @iot-rocket.+- **CloudFront — SaaS Manager (multi-tenant distributions)** — connection groups and distribution tenants provision with ETag / `If-Match` concurrency, per-tenant WAF association, tenant invalidations, and domain tooling. A tenant requires a `tenant-only` distribution (`InvalidAssociation`), CNAMEs are unique across tenants and distribution aliases (`CNAMEAlreadyExists`), deleting a distribution or connection group that still has tenants is refused (`ResourceInUse` / `CannotDeleteEntityWhileInUse`), and both families are taggable; async deploy, DNS and certificate workflows resolve immediately. Contributed by @mjdavidson.+- **EC2 — instances can have a real box behind them (`RegisterImage`)** — `RunInstances` returned a `running` record and booted nothing. `RegisterImage` now takes a container reference in `ImageLocation` and returns an `ami-` id whose launch boots that image as a container, its IP becoming the instance's address so `ssm:SendCommand` can report a real exit code. Such an AMI is `instance-store` backed (`StopInstances` / `StartInstances` answer `UnsupportedOperation`); registering is the only opt-in, so with nothing registered EC2 never reaches for Docker. `RebootInstances` also now rejects an unknown id with `InvalidInstanceID.NotFound` instead of returning `true` for any id. Contributed by @iot-rocket.+- **SSM — Run Command** — `SendCommand`, `GetCommandInvocation`, `ListCommands` and `DescribeInstanceInformation` returned `InvalidAction`. Invocations are now asynchronous as on AWS: `SendCommand` answers `Pending` and the caller polls to a terminal state, `AWS-RunShellScript` runs in the instance's container so `Status` reflects the real exit code, and an instance with no agent answering is refused `InvalidInstanceId`. Contributed by @bandle.+- **S3 — Glacier and Deep Archive restore (`RestoreObject`)** — an object in the `GLACIER` or `DEEP_ARCHIVE` storage class is now unreadable until restored: `GET`/`HEAD` is refused `403 InvalidObjectState`, `RestoreObject` runs an asynchronous restore, and `x-amz-restore` reports the ongoing request then the restored copy's expiry. `GLACIER_IR` stays readable and a `RestoreObject` against it fails `ObjectAlreadyInActiveTierError`, as on AWS. Reported by @mbenja086.++### Changed+- **Docker — the `full` image is smaller** — unused payload trimmed from the full variant. Reported by @areson.### Fixed-- **RDS — `DescribeDBInstances` honors SDK `Filters`** — AWS Query clients serialize filters as `Filters.Filter.N` with `Values.Value.N`, but MiniStack only parsed its internal `Filters.member.N` form, so filters such as `db-cluster-id` were ignored and unrelated instances were returned. Both wire forms are now parsed with the existing AND-across-filters and OR-across-values semantics.-- **S3 — a conditional delete of a key with no current object answers 404** — `DeleteObject` carrying `If-Match` returned 204 for a key that was absent, hidden by a delete marker, or held only delete markers, so a compare-and-swap delete reported success for work it never did. The condition is now evaluated against the current version and nothing else: no current object answers `NoSuchKey`, a differing ETag answers `PreconditionFailed`, and a matching ETag or `If-Match: *` deletes. `DeleteObjects` reports the same absent key under `<Error>` as `NoSuchKey` rather than `PreconditionFailed`, and honours `*` in the `ETag` element instead of comparing it literally.+- **IAM — a CloudFormation-provisioned policy no longer breaks the read APIs** — stack-created policies and attachments wrote shapes the IAM API never produced (`AttachedPolicies` as `{PolicyName, PolicyArn}` dicts, `Versions` as a list), so `GetAccountAuthorizationDetails`, `ListAttachedRolePolicies` and `ListPolicyVersions` errored or never matched. They now go through the IAM module, so one shape reaches every reader, `AWS::IAM::ManagedPolicy` honours its `Roles` / `Users` / `Groups`, and both resource types return the `Fn::GetAtt` attributes CloudFormation documents. Reported by @iot-rocket.+- **Lambda — Node.js ESM handlers using top-level `await` load correctly** — a handler whose module graph contains a top-level `await` throws Node's `ERR_REQUIRE_ASYNC_MODULE`, which fell through to an uncaught `RuntimeError`; both Node bootstraps now treat it like `ERR_REQUIRE_ESM` and fall back to dynamic `import()`. Contributed by @ryan-bennett.+- **Cognito — `ListUsers` `Filter` matches values case-insensitively** — every comparison was an exact string match, so `email = "[email protected]"` missed a profile stored as `[email protected]`. Values are now matched case-insensitively for `email`, `phone_number`, `name`, `sub` and the other profile attributes, while `username` and `status` stay case-sensitive per the API reference. Contributed by @ppettitau.+- **DynamoDB — an `UpdateExpression` alias is resolved before the key-attribute check** — `set #pk = :pk` with `#pk` mapped to a non-key attribute was wrongly refused with `Cannot update attribute pk. This attribute is part of the key`; the check now reads the alias-resolved roots, so only a path that resolves to the partition or sort key is rejected. Reported by @ppettitau.+- **RDS — `DescribeDBInstances` honors SDK `Filters`** — clients serialize filters as `Filters.Filter.N` with `Values.Value.N`, but only the internal `Filters.member.N` form was parsed, so filters such as `db-cluster-id` were ignored. Both wire forms are now parsed. Contributed by @jayjanssen.+- **S3 — a conditional delete of a key with no current object answers 404** — `DeleteObject` with `If-Match` returned 204 for a key that was absent or hidden by a delete marker, so a compare-and-swap delete reported success it never did. The condition is now evaluated against the current version only: no current object answers `NoSuchKey`, a differing ETag `PreconditionFailed`, and a matching ETag or `If-Match: *` deletes. Reverted and fixed from 1.4.21.+- **S3 — one canonical owner ID across every S3 API** — `ListBuckets`, `GetBucketAcl`, `GetObjectAcl` and object listings returned the account id (or a placeholder) and disagreed with one another; they now return a single stable opaque 64-character hex canonical ID, as real S3 does. Reported by @jin-gizmo.+- **EC2 — `DescribeAvailabilityZones` reports the zone-group fields** — each zone was missing `groupName`, `networkBorderGroup` and `optInStatus`, so a consumer that reads them (Terraform's `aws_availability_zones` data source) saw them absent; standard zones now report them with an `opt-in-not-required` status.## [1.4.21] — 2026-08-20diff --git a/README.md b/README.mdindex 2439c203..92265c89 100644--- a/README.md+++ b/README.md@@ -987,7 +987,7 @@ launches against that id get a real box, so `ssm:SendCommand` can return a realof always reporting success.```bash-# 1. Register any image your Docker or Podman daemon can pull as an AMI+# 1. Register any image your daemon can resolve, local or from a registryaws --endpoint-url=http://localhost:4566 ec2 register-image \--name my-box --image-location ghcr.io/you/my-box:1.0# { "ImageId": "ami-0a1b2c3d4e5f60718" }@@ -1000,6 +1000,11 @@ aws --endpoint-url=http://localhost:4566 ec2 run-instances \aws --endpoint-url=http://localhost:4566 ec2 describe-instances```+A locally built tag counts. The image is only pulled when the daemon does not+already have it, so `docker build -t my-box:dev .` then registering `my-box:dev` needs+no registry, no push and no credentials — which also means CI can build and launch an+image without registry access. Rebuild the tag and the next `RunInstances` picks it up.+No configuration: registering an image is the opt-in. With nothing registered, EC2 never reachesfor Docker at all, and an unregistered `ami-` id keeps launching the metadata-only record it alwaysdid. Both kinds of instance coexist in one account and region.diff --git a/pyproject.toml b/pyproject.tomlindex cc5c59fc..6364f588 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"[project]name = "ministack"-version = "1.4.21"+version = "1.5.0"description = "Free, open-source local AWS emulator — drop-in LocalStack replacement"readme = "README.md"license = { file = "LICENSE" }