Skip to content

Ministack: Free, open-source local AWS emulator - 60+ services, Terraform compatible, real databases. Free forever. MIT licensed.

release v1.3.61 (#878)

Nahuel Nucera523ae0f865d9
diff --git a/.github/workflows/docker-publish-on-pr.yml b/.github/workflows/docker-publish-on-pr.yml
index 9f0c5cbe..04e06a71 100644
--- a/.github/workflows/docker-publish-on-pr.yml
+++ b/.github/workflows/docker-publish-on-pr.yml
@@ -8,7 +8,48 @@ env:
DOCKERHUB_IMAGE_ORG: ministackorg/ministack-preview-build
jobs:
+ # Path-based guard. pull_request_target runs with repo secrets
+ # (DOCKERHUB_TOKEN) and builds the PR's code, so any PR that touches the
+ # build/CI surface (Dockerfile*, .dockerignore, anything under .github/)
+ # must NOT be auto-built — a maintainer reviews and builds it manually.
+ # The changed-file list is read through the API only; this job never checks
+ # out PR-controlled code.
+ guard:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ pull-requests: write
+ outputs:
+ skip: ${{ steps.paths.outputs.skip }}
+ steps:
+ - name: Detect changes to the build/CI surface
+ id: paths
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: |
+ files=$(gh pr view "${{ github.event.pull_request.number }}" \
+ --repo "${{ github.repository }}" --json files --jq '.files[].path')
+ echo "Changed files:"; echo "$files"
+ if echo "$files" | grep -qE '^(Dockerfile([.].*)?|\.dockerignore|\.github/)'; then
+ echo "skip=true" >> "$GITHUB_OUTPUT"
+ echo "::warning::PR modifies the build/CI surface; auto-preview skipped pending manual maintainer build."
+ else
+ echo "skip=false" >> "$GITHUB_OUTPUT"
+ fi
+ - name: Comment that auto-preview was skipped
+ if: steps.paths.outputs.skip == 'true'
+ uses: peter-evans/create-or-update-comment@v4
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ issue-number: ${{ github.event.pull_request.number }}
+ body: |
+ Auto-preview build skipped: this PR modifies the build/CI surface
+ (`Dockerfile`, `.dockerignore`, or files under `.github/`). A maintainer
+ will review and build the preview image manually before it is published.
+
publish-pr:
+ needs: guard
+ if: needs.guard.outputs.skip != 'true'
runs-on: ubuntu-latest
permissions:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c77c0949..ef500f92 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,18 @@ Versioning follows [Semantic Versioning](https://semver.org/).
---
+## [1.3.61] — 2026-06-10
+
+### Added
+- **AmazonMQ (`mq`)** — new service emulator for AWS MQ, covering both RabbitMQ and ActiveMQ engines. Broker control plane: `CreateBroker`, `ListBrokers`, `DescribeBroker`, `UpdateBroker`, `DeleteBroker`, `RebootBroker`, plus `DescribeBrokerEngineTypes` and `DescribeBrokerInstanceOptions` (engine / version / instance / storage matrix sourced from real `aws mq describe-broker-instance-options` output). ActiveMQ user management (`CreateUser`, `DescribeUser`, `UpdateUser`, `DeleteUser`, `ListUsers`) and broker tagging (`CreateTags`, `ListTags`, `DeleteTags`). Brokers come up `RUNNING` immediately (metadata only, no container); `CreateBroker` validates engine type, version, deployment mode, host instance type, and storage type against the supported matrix. State is account-scoped and persisted. Contributed by @lucas-giaco.
+- **IAM — `GetAccountSummary`, `GetAccountPasswordPolicy`, `UpdateAccountPasswordPolicy`, `DeleteAccountPasswordPolicy`, `ListAccountAliases`, `CreateAccountAlias`, `DeleteAccountAlias`** — account-level posture reads. `GetAccountSummary` returns computed counts (`Users`, `Groups`, `Roles`, `Policies`, `MFADevices`, `MFADevicesInUse`, `AccountMFAEnabled`) plus static quotas. `GetAccountPasswordPolicy` returns `NoSuchEntity` (404) before any policy is set, matching real AWS. Account aliases stored per-account (replace-on-create semantics). Contributed by @lahmish.
+- **IAM — `GenerateCredentialReport`, `GetCredentialReport`** — generates and returns the account credential report as a CSV (exact AWS column header). One row per user including `password_enabled` (from login profiles), `mfa_active` (from MFA device assignments), and `access_key_1/2_active` (from access-key status). Root account synthetic row included. `GetCredentialReport` returns `ReportNotPresent` (410) when no report has been generated. `Content` is base64-encoded per the AWS blob encoding contract. Contributed by @lahmish.
+
+### Fixed
+- **S3 — event notifications now fire for non-default accounts** — `PutObject` / object-removed notifications are delivered from a background thread that did not inherit the request's account context, so the worker ran under the default account (`000000000000`): the account-scoped bucket-notification config resolved empty and the event was silently dropped for any non-default account, while SQS / SNS / Lambda / EventBridge targets resolved under the wrong account. The thread now copies the request context (account + region); the `s3:TestEvent` path had the same gap and is fixed too. Reported by @rsking.
+
+---
+
## [1.3.60] — 2026-06-09
### Added
@@ -21,9 +33,6 @@ Versioning follows [Semantic Versioning](https://semver.org/).
- **SQS — out-of-range numeric attributes rejected with `InvalidAttributeValue`** — `CreateQueue` and `SetQueueAttributes` accepted any value and stored it verbatim, so `VisibilityTimeout=99999` (and every other numeric attribute) was silently kept. Now `VisibilityTimeout` (0..43200), `MaximumMessageSize` (1024..262144), `MessageRetentionPeriod` (60..1209600), `DelaySeconds` (0..900), `ReceiveMessageWaitTimeSeconds` (0..20), and `KmsDataKeyReusePeriodSeconds` (60..86400) are validated against the AWS ranges and rejected with `InvalidAttributeValue` (400) when outside the documented bounds or non-numeric. Reported by @dcabib.
- **EventBridge — `anything-but` honors nested `prefix` / `suffix` / `wildcard` content filters** — `{"anything-but": {"prefix": "TEST-"}}` (and `suffix` / `wildcard` variants) was silently ignored at dispatch and every event matched regardless of the field value, because the handler only recognized literal and list-of-literal forms. The nested-matcher form per AWS docs is now negated correctly: an event whose field matches the nested filter is excluded. Reported by @aldirrix.
- **ElastiCache — Redis container respawned after restart** — with `PERSIST_STATE=1`, restored cluster metadata reported `CacheClusterStatus=available` but the persisted Docker container id no longer existed, so the endpoint was unreachable even though `DescribeCacheClusters` looked healthy. Restored clusters and replication groups are now marked pending respawn at `restore_state` time and lazily spawned (under a lock to prevent concurrent first-requests from double-spawning) on the first dispatcher call — endpoint metadata is rewritten to the freshly-spawned container before any caller can read it. Failures are logged once and cleared from the pending set (no retry storm). Reported by @ItsSmiffy.
-- **IAM — `GenerateCredentialReport`, `GetCredentialReport`** — generates and returns the account credential report as a CSV (exact AWS column header). One row per user including `password_enabled` (from login profiles), `mfa_active` (from MFA device assignments), and `access_key_1/2_active` (from access-key status). Root account synthetic row included. `GetCredentialReport` returns `ReportNotPresent` (410) when no report has been generated. `Content` is base64-encoded per the AWS blob encoding contract.
-- **IAM — `GetAccountSummary`, `GetAccountPasswordPolicy`, `UpdateAccountPasswordPolicy`, `DeleteAccountPasswordPolicy`, `ListAccountAliases`, `CreateAccountAlias`, `DeleteAccountAlias`** — account-level hygiene reads. `GetAccountSummary` returns computed counts (`Users`, `Groups`, `Roles`, `Policies`, `MFADevices`, `MFADevicesInUse`, `AccountMFAEnabled`) plus static quotas. `GetAccountPasswordPolicy` returns `NoSuchEntity` (404) before any policy is set, matching real AWS. Account aliases stored per-account (replace-on-create semantics).
-
---
## [1.3.59] — 2026-06-05
diff --git a/README.md b/README.md
index d4e3f414..b14dec51 100644
--- a/README.md
+++ b/README.md
@@ -356,8 +356,7 @@ subnet = ec2.create_subnet(
| **DynamoDB** | CreateTable, UpdateTable, DeleteTable, DescribeTable, ListTables, PutItem, GetItem, DeleteItem, UpdateItem, Query, Scan, BatchWriteItem, BatchGetItem, TransactWriteItems, TransactGetItems, DescribeTimeToLive, UpdateTimeToLive, DescribeContinuousBackups, UpdateContinuousBackups, DescribeEndpoints, TagResource, UntagResource, ListTagsOfResource, EnableKinesisStreamingDestination, DisableKinesisStreamingDestination, DescribeKinesisStreamingDestination, UpdateKinesisStreamingDestination | TTL enforced via thread-safe background reaper (60s cadence); DynamoDB Streams — `StreamSpecification` emits INSERT/MODIFY/REMOVE records on all write operations, respects `StreamViewType`; Kinesis streaming destinations (`aws_dynamodb_kinesis_streaming_destination`) fan item mutations out into any Kinesis stream by ARN while the destination is ACTIVE |
| **DynamoDB Streams** | ListStreams, DescribeStream, GetShardIterator, GetRecords | Reads records emitted by the main DynamoDB service via `boto3.client("dynamodbstreams")` — single synthetic shard per stream; `TRIM_HORIZON`/`LATEST`/`AT_SEQUENCE_NUMBER`/`AFTER_SEQUENCE_NUMBER` iterator types; `NEW_AND_OLD_IMAGES`, `NEW_IMAGE`, `OLD_IMAGE`, `KEYS_ONLY` view types; opaque base64 iterator tokens |
| **Lambda** | CreateFunction, DeleteFunction, GetFunction, GetFunctionConfiguration, ListFunctions, Invoke, UpdateFunctionCode, UpdateFunctionConfiguration, AddPermission, RemovePermission, GetPolicy, ListVersionsByFunction, PublishVersion, CreateAlias, GetAlias, UpdateAlias, DeleteAlias, ListAliases, TagResource, UntagResource, ListTags, CreateEventSourceMapping, DeleteEventSourceMapping, GetEventSourceMapping, ListEventSourceMappings, UpdateEventSourceMapping, CreateFunctionUrlConfig, GetFunctionUrlConfig, UpdateFunctionUrlConfig, DeleteFunctionUrlConfig, ListFunctionUrlConfigs, PutFunctionConcurrency, GetFunctionConcurrency, DeleteFunctionConcurrency, PutFunctionEventInvokeConfig, GetFunctionEventInvokeConfig, DeleteFunctionEventInvokeConfig, PublishLayerVersion, GetLayerVersion, GetLayerVersionByArn, ListLayerVersions, DeleteLayerVersion, ListLayers, AddLayerVersionPermission, RemoveLayerVersionPermission, GetLayerVersionPolicy, CheckpointDurableExecution, GetDurableExecution, GetDurableExecutionState, GetDurableExecutionHistory, ListDurableExecutionsByFunction, StopDurableExecution, SendDurableExecutionCallbackSuccess, SendDurableExecutionCallbackFailure, SendDurableExecutionCallbackHeartbeat | Python and Node.js runtimes execute with warm worker pool; `provided.al2023`/`provided.al2` runtimes execute via Docker RIE (Go, Rust, C++ support); `Publish=True` creates immutable numbered versions; Code via `ZipFile`, `S3Bucket`/`S3Key` (with optional `S3ObjectVersion`), or `ImageUri` (Docker image); `PackageType: Image` pulls and invokes user-provided Docker images via Lambda RIE; SQS, Kinesis, and DynamoDB Streams event source mappings; Function URL CRUD; Lambda Layers CRUD; Aliases; Concurrency; EventInvokeConfig; **Durable Functions** — `CreateFunction` accepts `DurableConfig`; checkpoint/state/history/list/stop ops at the preview API (`2025-12-01`); external `SendCallback{Success,Failure,Heartbeat}` resume the SDK across invocations; resume scheduler fires WAIT expiries, callback timeouts, and step-retry backoffs; verified against the official `aws-durable-execution-sdk-python` and `aws-durable-execution-sdk-java`; **X-Ray active tracing** — `TracingConfig.Mode=Active` injects `_X_AMZN_TRACE_ID` (`Root=1-<hex>-<hex>;Parent=<hex>;Sampled=1`) into the runtime per invocation so the AWS X-Ray SDK runs without `Missing AWS Lambda trace data`; supported on the warm Python / Node executor, provided runtimes, and the local subprocess fallback (docker RIE upstream does not implement X-Ray and is logged but unsupported) |
-| **IAM** | CreateUser, GetUser, ListUsers, DeleteUser, CreateRole, GetRole, ListRoles, DeleteRole, CreatePolicy, GetPolicy, DeletePolicy, AttachRolePolicy, DetachRolePolicy, PutRolePolicy, GetRolePolicy, DeleteRolePolicy, ListRolePolicies, ListAttachedRolePolicies, CreateAccessKey, ListAccessKeys, DeleteAccessKey, UpdateAccessKey, GetAccessKeyLastUsed, CreateInstanceProfile, GetInstanceProfile, DeleteInstanceProfile, AddRoleToInstanceProfile, RemoveRoleFromInstanceProfile, ListInstanceProfiles, CreateGroup, GetGroup, AddUserToGroup, RemoveUserFromGroup, CreateServiceLinkedRole, DeleteServiceLinkedRole, GetServiceLinkedRoleDeletionStatus, CreateOpenIDConnectProvider, ListOpenIDConnectProviders, CreateSAMLProvider, GetSAMLProvider, ListSAMLProviders, UpdateSAMLProvider, DeleteSAMLProvider, CreateLoginProfile, GetLoginProfile, UpdateLoginProfile, DeleteLoginProfile, CreateVirtualMFADevice, EnableMFADevice, DeactivateMFADevice, ResyncMFADevice, ListMFADevices, ListVirtualMFADevices, DeleteVirtualMFADevice, GetAccountAuthorizationDetails, GenerateServiceLastAccessedDetails, GetServiceLastAccessedDetails, TagRole, UntagRole, TagUser, UntagUser, TagPolicy, UntagPolicy , GenerateCredentialReport, GetCredentialReport | |
-| **IAM** | CreateUser, GetUser, ListUsers, DeleteUser, CreateRole, GetRole, ListRoles, DeleteRole, CreatePolicy, GetPolicy, DeletePolicy, AttachRolePolicy, DetachRolePolicy, PutRolePolicy, GetRolePolicy, DeleteRolePolicy, ListRolePolicies, ListAttachedRolePolicies, CreateAccessKey, ListAccessKeys, DeleteAccessKey, UpdateAccessKey, GetAccessKeyLastUsed, CreateInstanceProfile, GetInstanceProfile, DeleteInstanceProfile, AddRoleToInstanceProfile, RemoveRoleFromInstanceProfile, ListInstanceProfiles, CreateGroup, GetGroup, AddUserToGroup, RemoveUserFromGroup, CreateServiceLinkedRole, DeleteServiceLinkedRole, GetServiceLinkedRoleDeletionStatus, CreateOpenIDConnectProvider, ListOpenIDConnectProviders, CreateSAMLProvider, GetSAMLProvider, ListSAMLProviders, UpdateSAMLProvider, DeleteSAMLProvider, CreateLoginProfile, GetLoginProfile, UpdateLoginProfile, DeleteLoginProfile, CreateVirtualMFADevice, EnableMFADevice, DeactivateMFADevice, ResyncMFADevice, ListMFADevices, ListVirtualMFADevices, DeleteVirtualMFADevice, GetAccountAuthorizationDetails, GenerateServiceLastAccessedDetails, GetServiceLastAccessedDetails, TagRole, UntagRole, TagUser, UntagUser, TagPolicy, UntagPolicy , GetAccountSummary, GetAccountPasswordPolicy, UpdateAccountPasswordPolicy, DeleteAccountPasswordPolicy, ListAccountAliases, CreateAccountAlias, DeleteAccountAlias | |
+| **IAM** | CreateUser, GetUser, ListUsers, DeleteUser, CreateRole, GetRole, ListRoles, DeleteRole, CreatePolicy, GetPolicy, DeletePolicy, AttachRolePolicy, DetachRolePolicy, PutRolePolicy, GetRolePolicy, DeleteRolePolicy, ListRolePolicies, ListAttachedRolePolicies, CreateAccessKey, ListAccessKeys, DeleteAccessKey, UpdateAccessKey, GetAccessKeyLastUsed, CreateInstanceProfile, GetInstanceProfile, DeleteInstanceProfile, AddRoleToInstanceProfile, RemoveRoleFromInstanceProfile, ListInstanceProfiles, CreateGroup, GetGroup, AddUserToGroup, RemoveUserFromGroup, CreateServiceLinkedRole, DeleteServiceLinkedRole, GetServiceLinkedRoleDeletionStatus, CreateOpenIDConnectProvider, ListOpenIDConnectProviders, CreateSAMLProvider, GetSAMLProvider, ListSAMLProviders, UpdateSAMLProvider, DeleteSAMLProvider, CreateLoginProfile, GetLoginProfile, UpdateLoginProfile, DeleteLoginProfile, CreateVirtualMFADevice, EnableMFADevice, DeactivateMFADevice, ResyncMFADevice, ListMFADevices, ListVirtualMFADevices, DeleteVirtualMFADevice, GetAccountAuthorizationDetails, GenerateServiceLastAccessedDetails, GetServiceLastAccessedDetails, TagRole, UntagRole, TagUser, UntagUser, TagPolicy, UntagPolicy, GenerateCredentialReport, GetCredentialReport, GetAccountSummary, GetAccountPasswordPolicy, UpdateAccountPasswordPolicy, DeleteAccountPasswordPolicy, ListAccountAliases, CreateAccountAlias, DeleteAccountAlias | |
| **STS** | GetCallerIdentity, AssumeRole, GetSessionToken, AssumeRoleWithWebIdentity | |
| **IMDS** (EC2 Instance Metadata) | `PUT /latest/api/token`, `GET /latest/meta-data/instance-id`, `GET /latest/meta-data/iam/security-credentials/`, `GET /latest/meta-data/iam/security-credentials/<role>`, `GET /latest/meta-data/iam/info`, `GET /latest/meta-data/placement/{region,availability-zone,...}`, `GET /latest/dynamic/instance-identity/document` | IMDSv1 + IMDSv2; default credential chain falls through to a `ministack-instance-role` document with `ASIA*` session creds. Point SDKs at ministack via `AWS_EC2_METADATA_SERVICE_ENDPOINT=http://localhost:4566` (or `ec2_metadata_service_endpoint` in `~/.aws/config`); set `MINISTACK_IMDS_V2_REQUIRED=1` to require the token PUT |
| **ECS Task Metadata V4** | `GET /v4/<token>`, `GET /v4/<token>/task`, `GET /v4/<token>/stats`, `GET /v4/<token>/task/stats` | Per-container token injected as `ECS_CONTAINER_METADATA_URI_V4` on every container started by `RunTask`. `/task` returns sibling containers in the same task. Containers reach the gateway via `host.docker.internal` (mapped through `extra_hosts: host-gateway`, so it works on user-defined Docker networks); `networkMode: host` containers use loopback. Volatile by design (stripped on persistence, cleared by `/_ministack/reset`) |
diff --git a/pyproject.toml b/pyproject.toml
index a35a9ff9..422f5594 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "ministack"
-version = "1.3.60"
+version = "1.3.61"
description = "Free, open-source local AWS emulator — drop-in LocalStack replacement"
readme = "README.md"
license = { file = "LICENSE" }