Skip to content

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

release v1.3.60 (#859)

Nahuel Nucera4083fa9575ee
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9b5f8da7..caa8bf70 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,21 +7,20 @@ Versioning follows [Semantic Versioning](https://semver.org/).
---
-## [Unreleased]
+## [1.3.60] — 2026-06-09
### Added
-- **IAM — `GenerateServiceLastAccessedDetails`, `GetServiceLastAccessedDetails`** — Access Advisor generate→get job handshake. Returns a UUID `JobId`. `GetServiceLastAccessedDetails` returns `JobStatus=COMPLETED` and an empty `ServicesLastAccessed` list (no CloudTrail data).
+- **IAM — `CreateLoginProfile`, `GetLoginProfile`, `UpdateLoginProfile`, `DeleteLoginProfile`** — models whether an IAM user has a console password (the signal that a user is a human). `CreateLoginProfile` stores `UserName`, `CreateDate`, and `PasswordResetRequired` without persisting the password value (seed-side). `GetLoginProfile` returns `NoSuchEntity` (404) when no profile exists. `UpdateLoginProfile` updates `PasswordResetRequired`. `DeleteLoginProfile` removes the profile. All four operations match the real AWS request/response shapes exactly so identity-discovery agents can distinguish humans from service accounts using `get-login-profile`. Contributed by @lahmish.
+- **IAM — `CreateVirtualMFADevice`, `EnableMFADevice`, `DeactivateMFADevice`, `ResyncMFADevice`, `ListMFADevices`, `ListVirtualMFADevices`, `DeleteVirtualMFADevice`** — full virtual MFA device lifecycle. `CreateVirtualMFADevice` returns `SerialNumber` (ARN form `arn:aws:iam::<acct>:mfa/<name>`) plus `Base32StringSeed` and `QRCodePNG` blobs (base64-encoded). `EnableMFADevice` accepts any TOTP codes (seed-side lenience). `ListVirtualMFADevices` supports `AssignmentStatus` filter (`Assigned` / `Unassigned` / `Any`; default `Any`). `DeleteVirtualMFADevice` returns `DeleteConflict` (409) for assigned devices. Contributed by @lahmish.
+- **IAM — `GetAccountAuthorizationDetails`** — the one-shot identity graph. Returns `UserDetailList` (inline policies, attached managed policies, group memberships, tags), `GroupDetailList`, `RoleDetailList` (inline policies, attached managed policies, instance profiles, tags, assume-role document url-encoded), and `Policies` (customer-managed, with url-encoded version documents). `Filter.member.N` honored: `User`, `Group`, `Role`, `LocalManagedPolicy`. `IsTruncated=false`; pagination optional. Contributed by @lahmish.
+- **IAM — `CreateSAMLProvider`, `GetSAMLProvider`, `ListSAMLProviders`, `UpdateSAMLProvider`, `DeleteSAMLProvider`, `ListOpenIDConnectProviders`** — SAML IdP CRUD plus OIDC provider enumeration. Accepts any non-empty `SAMLMetadataDocument` (real AWS requires valid XML ≥1000 chars; that validation is seed-side). `GetSAMLProvider` returns `SAMLMetadataDocument`, `CreateDate`, `ValidUntil`, and `Tags`. `ListOpenIDConnectProviders` returns `{Arn}` entries (create/get/delete existed previously). Enables agents to enumerate federated IdPs cross-referenced with role trust policies. Contributed by @lahmish.
+- **IAM — `GenerateServiceLastAccessedDetails`, `GetServiceLastAccessedDetails`** — Access Advisor generate→get job handshake. Returns a UUID `JobId`. `GetServiceLastAccessedDetails` returns `JobStatus=COMPLETED` and an empty `ServicesLastAccessed` list (no CloudTrail data). Contributed by @lahmish.
----
-- **IAM — `CreateSAMLProvider`, `GetSAMLProvider`, `ListSAMLProviders`, `UpdateSAMLProvider`, `DeleteSAMLProvider`** — SAML IdP CRUD. Accepts any non-empty `SAMLMetadataDocument` (real AWS requires valid XML ≥1000 chars; that validation is seed-side). `GetSAMLProvider` returns `SAMLMetadataDocument`, `CreateDate`, `ValidUntil`, and `Tags`. Enables agents to enumerate federated IdPs cross-referenced with role trust policies.
-- **IAM — `ListOpenIDConnectProviders`** — returns `{Arn}` entries for all OIDC providers in the account (create/get/delete existed previously). Completes the OIDC provider enumeration surface.
-
----
-- **IAM — `GetAccountAuthorizationDetails`** — the one-shot identity graph. Returns `UserDetailList` (inline policies, attached managed policies, group memberships, tags), `GroupDetailList`, `RoleDetailList` (inline policies, attached managed policies, instance profiles, tags, assume-role document url-encoded), and `Policies` (customer-managed, with url-encoded version documents). `Filter.member.N` honored: `User`, `Group`, `Role`, `LocalManagedPolicy`. `IsTruncated=false`; pagination optional.
-
----
-- **IAM — `CreateVirtualMFADevice`, `EnableMFADevice`, `DeactivateMFADevice`, `ResyncMFADevice`, `ListMFADevices`, `ListVirtualMFADevices`, `DeleteVirtualMFADevice`** — full virtual MFA device lifecycle. `CreateVirtualMFADevice` returns `SerialNumber` (ARN form `arn:aws:iam::<acct>:mfa/<name>`) plus `Base32StringSeed` and `QRCodePNG` blobs (base64-encoded). `EnableMFADevice` accepts any TOTP codes (seed-side lenience). `ListVirtualMFADevices` supports `AssignmentStatus` filter (`Assigned` / `Unassigned` / `Any`; default `Assigned`). `DeleteVirtualMFADevice` returns `DeleteConflict` (409) for assigned devices.
-- **IAM — `CreateLoginProfile`, `GetLoginProfile`, `UpdateLoginProfile`, `DeleteLoginProfile`** — models whether an IAM user has a console password (the signal that a user is a human). `CreateLoginProfile` stores `UserName`, `CreateDate`, and `PasswordResetRequired` without persisting the password value (seed-side). `GetLoginProfile` returns `NoSuchEntity` (404) when no profile exists. `UpdateLoginProfile` updates `PasswordResetRequired`. `DeleteLoginProfile` removes the profile. All four operations match the real AWS request/response shapes exactly so identity-discovery agents can distinguish humans from service accounts using `get-login-profile`.
+### Fixed
+- **Cognito — `RespondToAuthChallenge` / `AdminRespondToAuthChallenge` merge CUSTOM_AUTH verify result into the pending challenge round** — the verify result was appended as a second, metadata-less `session` entry, splitting one round across two records. AWS records **one** `ChallengeResult` per round, carrying both `challengeMetadata` (from `CreateAuthChallenge`) and `challengeResult` (from `VerifyAuthChallengeResponse`) — multi-round flows that read both fields from the same element (e.g. magic-link → SMS-OTP) never advanced. The pending round is now updated in place. Contributed by @AdigaAkhil.
+- **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.
---
diff --git a/README.md b/README.md
index f894de28..c84d270b 100644
--- a/README.md
+++ b/README.md
@@ -356,11 +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, TagRole, UntagRole, TagUser, UntagUser, TagPolicy, UntagPolicy, GenerateServiceLastAccessedDetails, GetServiceLastAccessedDetails | |
-| **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, TagRole, UntagRole, TagUser, UntagUser, TagPolicy, UntagPolicy, CreateSAMLProvider, GetSAMLProvider, ListSAMLProviders, UpdateSAMLProvider, DeleteSAMLProvider, ListOpenIDConnectProviders | |
-| **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, TagRole, UntagRole, TagUser, UntagUser, TagPolicy, UntagPolicy, GetAccountAuthorizationDetails | |
-| **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, TagRole, UntagRole, TagUser, UntagUser, TagPolicy, UntagPolicy, CreateVirtualMFADevice, EnableMFADevice, DeactivateMFADevice, ResyncMFADevice, ListMFADevices, ListVirtualMFADevices, DeleteVirtualMFADevice | |
-| **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, TagRole, UntagRole, TagUser, UntagUser, TagPolicy, UntagPolicy, CreateLoginProfile, GetLoginProfile, UpdateLoginProfile, DeleteLoginProfile | |
+| **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 | |
| **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/ministack/services/elasticache.py b/ministack/services/elasticache.py
index 69707e64..8784fe8f 100644
--- a/ministack/services/elasticache.py
+++ b/ministack/services/elasticache.py
@@ -110,6 +110,10 @@ def get_state():
# container is healthy by the time the SDK reaches the endpoint.
_pending_cluster_respawn: set = set()
_pending_rg_respawn: set = set()
+# Serialize lazy respawn so two concurrent first-requests after restart
+# don't both spawn a container for the same cluster.
+import threading as _threading
+_respawn_lock = _threading.Lock()
def restore_state(data):
@@ -144,8 +148,17 @@ def _ensure_live_containers():
don't retry on every request — the cluster's metadata is still served
but the endpoint won't be reachable (matches the old behavior, just no
longer silent)."""
+ # Cheap fast path — no lock needed when nothing's pending.
if not (_pending_cluster_respawn or _pending_rg_respawn):
return
+ # Serialize concurrent first-requests so we don't double-spawn.
+ with _respawn_lock:
+ if not (_pending_cluster_respawn or _pending_rg_respawn):
+ return
+ _ensure_live_containers_locked()
+
+
+def _ensure_live_containers_locked():
import logging
log = logging.getLogger(__name__)
for name in list(_pending_cluster_respawn):
diff --git a/pyproject.toml b/pyproject.toml
index d11cac80..a35a9ff9 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "ministack"
-version = "1.3.59"
+version = "1.3.60"
description = "Free, open-source local AWS emulator — drop-in LocalStack replacement"
readme = "README.md"
license = { file = "LICENSE" }