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.12
Nahuel990ea3e56a347d2
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 60fdd94b..d334af40 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -8,26 +8,24 @@ Versioning follows [Semantic Versioning](https://semver.org/).## [1.5.12] — 2026-09-15### Added-- **EKS — Pod Identity associations** — the five operations did not exist, so a controller that reads pod identity to find its role, the AWS Load Balancer Controller among them, could not run against MiniStack. `CreatePodIdentityAssociation`, `DescribePodIdentityAssociation`, `ListPodIdentityAssociations` (filtered by `namespace` and `serviceAccount`), `UpdatePodIdentityAssociation` and `DeletePodIdentityAssociation` serve the records, one per namespace and service account, with an `externalId` minted for a `targetRoleArn` chain. Reported by @josephaw1022.-- **EKS — `aws eks update-kubeconfig` works against MiniStack** — k3s could not authenticate the IAM exec token `aws eks get-token` produces, so the only way in was to copy the admin kubeconfig out of the container. MiniStack now answers a TokenReview webhook for the cluster: `AUTH=false` accepts local bearer tokens, `AUTH=true` verifies the presigned token's signature, cluster binding and lifetime and then requires a creator or Access Entry grant, including account-scoped STS sessions. The five general-purpose access policies (`AmazonEKSClusterAdminPolicy`, `AmazonEKSAdminPolicy`, `AmazonEKSEditPolicy`, `AmazonEKSViewPolicy`, `AmazonEKSAdminViewPolicy`) grant their published Kubernetes permissions, at cluster or namespace scope including wildcard patterns, and disassociating a policy or deleting its Access Entry revokes them. Contributed by @jgrumboe. Reported by @StraggleCraft.--### Fixed-- **S3 — a notification configuration whose destination does not exist is refused** — `PutBucketNotificationConfiguration` stored the configuration and swallowed the failed test delivery, so a queue or topic that was not there looked like a successful setup and no event ever arrived. AWS verifies an SNS or SQS destination by sending it a test notification, and "if the message fails, the entire PUT action will fail, and Amazon S3 will not add the configuration to your bucket": a missing queue or topic is now `InvalidArgument` (400) with nothing stored. A Lambda destination is still not checked, since AWS verifies that one through the function's permissions. Reported by @ortizgui.-- **ECS — a task walks the whole lifecycle** — a Docker-backed task went straight from `PENDING` to `RUNNING` to `STOPPED`, so a consumer waiting on any other state waited forever. It now reports the states AWS documents, in order: `PROVISIONING` at `RunTask` whatever the network mode, `PENDING` while it waits on the agent, `ACTIVATING` for the image pull, then `DEACTIVATING`, `STOPPING`, `DEPROVISIONING` and `STOPPED`. Every starting state counts against a service's desired capacity, while `pendingCount` and `pendingTasksCount` still count `PENDING` alone as the API model defines them. `executionStoppedAt` is now set. Reported by @iot-rocket.-- **Cognito — a hosted-UI request that invokes a Lambda trigger no longer deadlocks** — `/saml2/idpresponse`, `/oauth2/idpresponse` and `/oauth2/token` ran on the event loop, so a PreSignUp or PreTokenGeneration trigger calling back into MiniStack queued behind its own request, timed out and surfaced as a `400`. All three now run off the loop. Two races the change exposed close with it: a replayed authorization code gets `invalid_grant`, the error AWS returns for a code "consumed already or does not exist", instead of a `500`. Contributed by @kjdev.-- **SQS — every batch action validates the request before its entries** — the ten-entry limit reached `SendMessageBatch` only, and three more request-level errors the SQS model declares on all three batch actions were never raised. `DeleteMessageBatch` and `ChangeMessageVisibilityBatch` now refuse an empty `Entries` list, more than ten entries, repeated ids and a malformed id, with `EmptyBatchRequest`, `TooManyEntriesInBatchRequest`, `BatchEntryIdsNotDistinct` and `InvalidBatchEntryId`. These fail the whole request rather than landing in `Failed`, as on AWS. Contributed by @CaptainAni187. Reported by @jespinoza-shippo.-- **SES — one v2 implementation, returning the v1 `MessageId` shape** — `ses.py` carried an inline copy of the v2 endpoints that duplicated `ses_v2.py`, and the path router had already been sending `/v2/email/*` to `ses_v2`, so the copy was unreachable and the two had drifted. The duplicate is gone and every v2 request, by path or by `SESv2.*` target header, is served by one implementation. That surfaced a divergence the dead copy had hidden: `SendEmail` and `SendBulkEmail` answered an id prefixed `ministack-`, where the six v1 send paths return `<uuid>@email.amazonses.com`. Both now return the shared shape. Contributed by @jgrumboe.-- **EKS — a deleted cluster takes its access entries and pod identity associations with it** — both stores are keyed by cluster name and neither was swept on `DeleteCluster`, so they outlived the cluster and a new one created under the same name inherited the previous cluster's grants and role ARNs. They are now removed with the cluster, along with their tags.-- **Persistence — four services keep their state across a restart** — the save map was maintained by hand next to `SERVICE_REGISTRY`, and `cloudcontrol`, `config`, `cur` and `organizations` were never added to it, so everything they held was dropped on every warm boot. The map is now derived from the registry, which also covers the modules a service reaches through its own dispatcher, and a test refuses any service that would be saved without a way to restore it. Every service module now declares the same `get_state` / `load_persisted_state` / `reset` contract, which is what the derivation reads. Contributed by @jgrumboe.-- **IAM — a resource-scoped policy matches, instead of denying** — under `AUTH=true` the resource ARN resolved to `*` for whole families of request, so only a grant written `Resource: "*"` matched and everything narrower was denied. IoT jobs and provisioning templates now resolve to `job/<id>` and `provisioningtemplate/<name>`, both IoT data planes reach the same branch, an MQTT topic resolves to its full multi-level path, and an API Gateway invoke resolves to `<api-id>/<stage>/<METHOD>/<path>`. A query-protocol POST carries its whole form body into resolution, not just `Action`. Contributed by @iot-rocket.-- **CloudFormation — `AWS::IAM::Policy` is provisioned inline, not as a managed policy** — the document was stored as an account-global managed policy and attached, where CloudFormation embeds it on each Role, User and Group it names, as `PutRolePolicy` does. An inline policy is scoped to its entity, so the same `PolicyName` can exist on many at once; CDK derives that name from the construct path, so stacks sharing a path collapsed onto one record and each deploy took the grants from the ones before it. `ListRolePolicies`, `GetRolePolicy` and `GetAccountAuthorizationDetails` now report it and the IAM evaluator finds it. `AWS::IAM::ManagedPolicy` is unchanged. Contributed by @iot-rocket.-- **Lambda — SQS event source batches are dispatched concurrently** — one thread polled every mapping and waited for each invoke, so a handler that took 10 seconds held a message on an unrelated queue for about 8.6 seconds, and `ScalingConfig.MaximumConcurrency` was stored but ignored. Batches now run off the poll thread, up to `MaximumConcurrency` per mapping (default 5), lowered to the function's `ReservedConcurrentExecutions`. A FIFO event source is held to one batch at a time whatever that setting says, since a batch is built across message groups and Amazon SQS "ensures that messages in the same group are delivered to Lambda in order". Kinesis and DynamoDB Streams still process one batch at a time. Contributed by @ThailerL.-- **ECS — a task's `version` counts its state changes** — the counter was minted at `1` and never moved, so a consumer holding an older `DescribeTasks` copy could not tell it from the current one, which is the comparison the field exists for. It now moves on each change the record reports, measured against a real Fargate task: `1` at `PROVISIONING`, `2` at `PENDING`, `3` at `RUNNING`, `4` when `StopTask` set `desiredStatus`, `5` at `DEPROVISIONING`, `6` at `STOPPED`. Contributed by @iot-rocket.-- **ECS — only an `awsvpc` task reports an elastic network interface** — every task got an `ElasticNetworkInterface` attachment once its container was up, whatever its network mode, while the Task reference describes `attachments` as the adapter a task has "if the task uses the `awsvpc` network mode": a `bridge` or `host` task on AWS reports none and is reached through its container instance. A task in those modes now reports an empty list, an `awsvpc` task's attachment additionally names the subnet the request placed it in, and the address stays available to the target-group sync in every mode. Contributed by @iot-rocket.-- **ECS — a task no longer reports `attachmentsStatus`** — the task record carried an `attachmentsStatus` member next to its attachment, and there is no such member on the `Task` shape: the API model has it on `Cluster` only, and a live task on AWS, awsvpc and bridge alike, sends no such field. A client reading the raw wire saw an invented member, and the emulator was the only place it existed. The cluster's own `attachmentsStatus` is untouched. Contributed by @iot-rocket.-- **ECS — the task metadata endpoint reports the status the task is in** — `${ECS_CONTAINER_METADATA_URI_V4}` served `DesiredStatus` and `KnownStatus` as the literal `RUNNING`, captured at registration, so a container reading its own metadata was told the task was running while `DescribeTasks` reported otherwise, for the length of the image pull. Both are now seeded from the task record and pushed at each transition. `KnownStatus` is the task's on the task payload and the container's own on a container payload, because AWS reports them separately. Contributed by @iot-rocket.-- **IAM — one `_account_from_arn`, with the contract the condition evaluator documents** — the module carried two top-level definitions under the same name, so the later silently won and the guards the documented one describes were not the ones in force when `aws:ResourceAccount` resolved a resource's account. They are folded into one: the field is returned only when it holds a twelve-digit account id, and only from a value that is an ARN. No request changes behaviour. Contributed by @iot-rocket.-- **Test harness — the suite runs on a non-default `GATEWAY_PORT`** — eight tests compared a value a service had built from `GATEWAY_PORT` against a hard-coded `4566`, so the suite passed only on the default port. That is the port a contributor moves off to run a private server rather than resetting a shared one, which is exactly when the failures appear and look like real regressions. The ESM tests now key their queues through `sqs._queue_url()`, the AppSync and Glue assertions read the port from one place in `tests/conftest.py`, and the three files pass on any port. No user-visible behavior changes. Contributed by @iot-rocket.+- **EKS — Pod Identity associations** — the five operations did not exist, so a controller that reads pod identity to find its role, the AWS Load Balancer Controller among them, could not run against MiniStack. Create, Describe, List, Update and Delete serve the records, one per namespace and service account. Deleting a cluster removes them with it. Reported by @josephaw1022.+- **EKS — `aws eks update-kubeconfig` works against MiniStack** — k3s could not authenticate the IAM exec token `aws eks get-token` produces, so the only way in was to copy the admin kubeconfig out of the container. MiniStack now answers a TokenReview webhook: `AUTH=false` accepts local bearer tokens, `AUTH=true` verifies the presigned token and then requires a creator or Access Entry grant. The five general-purpose access policies grant their published Kubernetes permissions at cluster or namespace scope. Contributed by @jgrumboe. Reported by @StraggleCraft.++### Fixed+- **S3 — a notification configuration whose destination does not exist is refused** — the configuration was stored and the failed test delivery swallowed, so a queue or topic that was not there looked like a successful setup and no event ever arrived. AWS verifies an SQS or SNS destination by sending it a test notification and fails the whole PUT when it does not arrive; a missing one is now `InvalidArgument` with nothing stored. Reported by @ortizgui.+- **ECS — a task walks the whole lifecycle** — a Docker-backed task went straight from `PENDING` to `RUNNING` to `STOPPED`, so a consumer waiting on any other state waited forever. It now reports the states AWS documents, in order: `PROVISIONING`, `PENDING`, `ACTIVATING`, then `DEACTIVATING`, `STOPPING`, `DEPROVISIONING` and `STOPPED`. Every starting state counts against a service's desired capacity, while `pendingCount` counts `PENDING` alone as the API model defines it. Reported by @iot-rocket.+- **ECS — a task's `version` counts its state changes** — the counter was minted at `1` and never moved, so a consumer could not tell a stale `DescribeTasks` copy from the current one. It now moves on each change the record reports, matching a real Fargate task: `1` at `PROVISIONING` through `6` at `STOPPED`. Contributed by @iot-rocket.+- **ECS — only an `awsvpc` task reports an elastic network interface** — every task got an `ElasticNetworkInterface` attachment once its container was up, whatever its network mode, while the Task reference describes `attachments` as the adapter a task has "if the task uses the `awsvpc` network mode". Other modes now report an empty list, and an `awsvpc` attachment names the subnet the request placed the task in. Contributed by @iot-rocket.+- **ECS — a task no longer reports `attachmentsStatus`** — the task record carried the member next to its attachment, and there is no such member on the `Task` shape: the API model has it on `Cluster` only. A client reading the raw wire saw an invented field. Contributed by @iot-rocket.+- **ECS — the task metadata endpoint reports the status the task is in** — `${ECS_CONTAINER_METADATA_URI_V4}` served `DesiredStatus` and `KnownStatus` as the literal `RUNNING`, captured at registration, so a container reading its own metadata was told the task was running while `DescribeTasks` reported otherwise. Both now follow the task record, with `KnownStatus` per container as AWS reports it. Contributed by @iot-rocket.+- **Cognito — a hosted-UI request that invokes a Lambda trigger no longer deadlocks** — `/saml2/idpresponse`, `/oauth2/idpresponse` and `/oauth2/token` ran on the event loop, so a trigger calling back into MiniStack queued behind its own request and timed out as a `400`. All three now run off the loop, and a replayed authorization code gets `invalid_grant` instead of a `500`. Contributed by @kjdev.+- **SQS — every batch action validates the request before its entries** — the ten-entry limit reached `SendMessageBatch` only, and three more request-level errors the model declares on all three batch actions were never raised. `DeleteMessageBatch` and `ChangeMessageVisibilityBatch` now refuse an empty batch, more than ten entries, repeated ids and malformed ids, failing the whole request rather than landing in `Failed`. Contributed by @CaptainAni187.+- **SES — one v2 implementation, returning the v1 `MessageId` shape** — `ses.py` carried an unreachable copy of the v2 endpoints that had drifted from `ses_v2.py`. The duplicate is gone and every v2 request is served by one implementation, which surfaced a divergence it had hidden: `SendEmail` answered an id prefixed `ministack-`, where the v1 paths return `<uuid>@email.amazonses.com`. Both now return the shared shape. Contributed by @jgrumboe.+- **Persistence — four services keep their state across a restart** — the save map was maintained by hand, and `cloudcontrol`, `config`, `cur` and `organizations` were never added to it, so their state was dropped on every warm boot. It is now derived from `SERVICE_REGISTRY`, and a test refuses any service that would be saved without a way to restore it. Contributed by @jgrumboe.+- **IAM — a resource-scoped policy matches, instead of denying** — under `AUTH=true` the resource ARN resolved to `*` for whole families of request, so only `Resource: "*"` matched and everything narrower was denied. IoT jobs, provisioning templates, both IoT data planes, multi-level MQTT topics and API Gateway invokes now resolve to their real ARNs. Contributed by @iot-rocket.+- **CloudFormation — `AWS::IAM::Policy` is provisioned inline, not as a managed policy** — the document was stored as an account-global managed policy and attached, where CloudFormation embeds it on each Role, User and Group it names. CDK derives `PolicyName` from the construct path, so stacks sharing a path collapsed onto one record and each deploy took the grants from the ones before it. `ListRolePolicies` and `GetAccountAuthorizationDetails` now report it and the IAM evaluator finds it. Contributed by @iot-rocket.+- **Lambda — SQS event source batches are dispatched concurrently** — one thread polled every mapping and waited for each invoke, so a slow handler held messages on unrelated queues, and `ScalingConfig.MaximumConcurrency` was stored but ignored. Batches now run off the poll thread, up to `MaximumConcurrency` per mapping, with a FIFO event source held to one at a time so message groups keep their order. Contributed by @ThailerL.+- **Test harness — the suite runs on a non-default `GATEWAY_PORT`** — eight tests compared a value a service had built from `GATEWAY_PORT` against a hard-coded `4566`, so the suite passed only on the default port, which is exactly the port a contributor moves off to avoid resetting a shared server. Contributed by @iot-rocket.## [1.5.11] — 2026-09-13diff --git a/README.md b/README.mdindex 2dd68232..84906261 100644--- a/README.md+++ b/README.md@@ -397,7 +397,7 @@ subnet = ec2.create_subnet(| Service | Operations | Notes ||---------|-----------|-------|| **S3** | CreateBucket, DeleteBucket, ListBuckets, HeadBucket, PutObject, GetObject, DeleteObject, HeadObject, CopyObject, ListObjects v1/v2, DeleteObjects, GetBucketVersioning, PutBucketVersioning, GetBucketEncryption, PutBucketEncryption, DeleteBucketEncryption, GetBucketLifecycleConfiguration, PutBucketLifecycleConfiguration, DeleteBucketLifecycle, GetBucketCors, PutBucketCors, DeleteBucketCors, GetBucketAcl, PutBucketAcl, GetBucketTagging, PutBucketTagging, DeleteBucketTagging, GetBucketPolicy, PutBucketPolicy, DeleteBucketPolicy, GetBucketNotificationConfiguration, PutBucketNotificationConfiguration, GetBucketLogging, PutBucketLogging, ListObjectVersions, CreateMultipartUpload, UploadPart, CompleteMultipartUpload, AbortMultipartUpload, PutObjectLockConfiguration, GetObjectLockConfiguration, PutObjectRetention, GetObjectRetention, PutObjectLegalHold, GetObjectLegalHold, PutBucketReplication, GetBucketReplication, DeleteBucketReplication, GetObjectTagging, PutObjectTagging, DeleteObjectTagging | Optional disk persistence via `S3_PERSIST=1`; Object Lock with retention & legal hold enforcement on delete; object tags are versioned (`?tagging&versionId=…` reads, writes, and deletes the per-version tag set); Multi-Region Access Points provision from CloudFormation (`AWS::S3::MultiRegionAccessPoint`) and `<alias>.accesspoint.s3-global.amazonaws.com` serves the member buckets through the regular S3 path |-| **SQS** | CreateQueue, DeleteQueue, ListQueues, GetQueueUrl, GetQueueAttributes, SetQueueAttributes, PurgeQueue, SendMessage, ReceiveMessage, DeleteMessage, ChangeMessageVisibility, ChangeMessageVisibilityBatch, SendMessageBatch, DeleteMessageBatch, TagQueue, UntagQueue, ListQueueTags | Both Query API and JSON protocol; FIFO queues with deduplication; DLQ support |+| **SQS** | CreateQueue, DeleteQueue, ListQueues, GetQueueUrl, GetQueueAttributes, SetQueueAttributes, PurgeQueue, SendMessage, ReceiveMessage, DeleteMessage, ChangeMessageVisibility, ChangeMessageVisibilityBatch, SendMessageBatch, DeleteMessageBatch, TagQueue, UntagQueue, ListQueueTags | Both Query API and JSON protocol; FIFO queues with deduplication; DLQ support; the batch actions apply AWS's request-level validation (empty batch, more than ten entries, repeated or malformed entry ids) before any entry is processed || **SNS** | CreateTopic, DeleteTopic, ListTopics, GetTopicAttributes, SetTopicAttributes, Subscribe, Unsubscribe, ListSubscriptions, ListSubscriptionsByTopic, GetSubscriptionAttributes, SetSubscriptionAttributes, ConfirmSubscription, Publish, PublishBatch, TagResource, UntagResource, ListTagsForResource, CreatePlatformApplication, ListPlatformApplications, GetPlatformApplicationAttributes, SetPlatformApplicationAttributes, CreatePlatformEndpoint, GetEndpointAttributes, SetEndpointAttributes, DeleteEndpoint, DeletePlatformApplication | SNS→SQS fanout delivery; SNS→Lambda fanout (asynchronous delivery); FIFO topics with 5-minute deduplication, sequence numbers, content-based deduplication, and subscription validation; mobile-push endpoint lifecycle with device-token dedup and `Publish` to platform-endpoint `TargetArn` || **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 |