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.3.17 (#512)
Nahuel Nucerad18819495839
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d00f87e0..5a303070 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -9,11 +9,22 @@ Versioning follows [Semantic Versioning](https://semver.org/).## [Unreleased]+---++## [1.3.17] — 2026-04-28+### Added- **`ministackorg/ministack:full` Docker variant** — Debian/glibc-based superset of the regular Alpine image, adding `duckdb` (Athena engine), `psycopg2-binary` (PostgreSQL driver), and `pymysql` (MySQL driver). DuckDB and psycopg2 ship `manylinux` wheels but no `musllinux` wheels, so on Alpine they either fall back to source-builds or silently disable themselves; the `:full` tag installs them cleanly. Published in lockstep with the regular image on every release: `:full` always points at the latest Debian build, alongside `:{version}-full` and `:{major}.{minor}-full`. The regular `:latest` / `:{version}` tags are unchanged. Full image reports `edition: full` on `/_ministack/health`; regular reports `edition: light`. Closes the long-standing Athena-on-Alpine gap raised by @arischow.+- **STS `GetWebIdentityToken` action** — implements AWS-spec validation: `SigningAlgorithm` is required and must be `RS256` or `ES384`; `Audience.member.N` is required, 1–10 items × 1–1000 chars; `DurationSeconds` is bounded 60–3600 (default 300). Returns a parseable JWT for OIDC dev flows. Signature is HS256 (not the publicly-verifiable RS256/ES384 real STS publishes via JWKS) — sufficient for emulator workloads that inspect claims, not for clients that verify against AWS JWKS. Requested by @anghel93.### Fixed-- **Step Functions child execution integrations now return child execution metadata** — `arn:aws:states:::states:startExecution` starts the nested execution and returns `ExecutionArn` / `StartDate` instead of echoing the request payload. `arn:aws:states:::aws-sdk:sfn:startExecution` now accepts AWS Step Functions' PascalCase integration parameters (`StateMachineArn`, `Input`, `Name`) by translating them to MiniStack's lower-camel Step Functions API shape.+- **Step Functions child execution integrations now return child execution metadata** — `arn:aws:states:::states:startExecution` starts the nested execution and returns `ExecutionArn` / `StartDate` instead of echoing the request payload. `arn:aws:states:::aws-sdk:sfn:startExecution` now accepts AWS Step Functions' PascalCase integration parameters (`StateMachineArn`, `Input`, `Name`) by translating them to MiniStack's lower-camel Step Functions API shape. Existing `.sync` and `.waitForTaskToken` paths preserved. Contributed by @jayjanssen.+- **STS `GetCallerIdentity` returned `arn:aws:iam::{account}:root` regardless of credentials** — tests obtaining temporary credentials via `AssumeRole` and then verifying the assumed-role identity could never confirm the role. Handler now extracts the `AccessKeyId` from the SigV4 `Authorization` header and looks it up in a session map populated by `AssumeRole` / `AssumeRoleWithWebIdentity`, returning the matching `arn:aws:sts::{account}:assumed-role/{role}/{session}` ARN and `{role-id}:{session}` UserId. Falls back to root for non-session credentials. Contributed by @hectormauer.+- **S3 virtual-hosted-style routing broke on non-`localhost` endpoints** — `_S3_VHOST_RE` was anchored to `_MINISTACK_HOST` (default `localhost`), so requests with `Host: bucket.ministack:4566` (Docker Compose service name) or any custom hostname fell through to S3 path-style with the wrong bucket — silently breaking AWS SDK for JavaScript v3 setups. Replaced with `_extract_s3_vhost_bucket(host)` which validates against AWS bucket-naming rules (3–63 chars, lowercase + digits + dots + hyphens, alphanum start/end, no `..`, not IPv4) and accepts any tail — vhost works against `localhost`, `ministack`, custom DNS, or `s3.amazonaws.com` without configuration. Verified against 40 host-header cases. The dead vhost branch in `s3.py:_parse_bucket_key` is removed since the rewrite happens at the routing layer. Reported by @mgius-ae.+- **Lambda routing missed every API path that wasn't `/2015-03-31/functions`** — the path-based service detector only matched the original Lambda API version date, so unsigned requests to `/2019-09-25/functions/.../event-invoke-config` (`PutFunctionEventInvokeConfig`), `/2019-09-30/functions/.../provisioned-concurrency`, `/2021-10-31/functions/.../url`, `/2018-10-31/layers`, `/2015-03-31/event-source-mappings`, `/2015-03-31/tags`, `/2016-08-19/account-settings`, `/2018-06-01/runtime/...`, and `/2020-04-22/code-signing-configs/...` all fell through to S3. boto3 always signs (so it routed via SigV4 credential scope), but raw HTTP / curl / the Lambda Runtime API itself missed. Detector now matches `^/{date}/{lambda-resource}/...` for every documented resource.+- **CloudFormation `AWS::Lambda::Function` never fetched S3 code** — `_lambda_create` stored `Code.S3Bucket` / `Code.S3Key` as metadata but never resolved them against the in-memory S3 service, so every CFN-deployed S3-backed Lambda had `code_zip = None` and failed to invoke. Inline `ZipFile` was unaffected; everything else broken. Provisioner now fetches the bytes via the standard Lambda S3 helper. Contributed by @hiddengearz.+- **Lambda warm-worker execution path was missing standard runtime env vars** — `lambda_runtime.py`'s warm-worker path didn't inject `AWS_REGION`, `AWS_DEFAULT_REGION`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN`, `AWS_LAMBDA_FUNCTION_VERSION`, or `AWS_LAMBDA_LOG_STREAM_NAME`, while the Docker execution path already did. Functions calling `boto3.client(...)`, X-Ray tracers, CloudWatch metric emitters, and any code branching on `$LATEST` vs published versions ran with an inconsistent environment compared to AWS. Warm-worker now injects the full set, matching Docker mode and AWS spec. Contributed by @hiddengearz.+- **4 AWS wire-format compliance bugs.** STS `AssumeRole` / `AssumeRoleWithWebIdentity` returned `arn:aws:iam::...:assumed-role/...` for the assumed-role principal — real AWS uses `arn:aws:sts::...:assumed-role/{role}/{session}` (any IAM-policy `Condition: aws:PrincipalArn` checking against the sts shape would mismatch). API Gateway v1 `PutIntegration` returned HTTP 200 instead of 201. EventBridge `StartReplay` started in `RUNNING` state instead of `STARTING` (background thread still transitions `RUNNING` → `COMPLETED`). SNS `Subscribe` returned `PendingConfirmation` as `SubscriptionArn` for HTTP/email pending subscriptions — real AWS returns lowercase `pending confirmation` (with the space).---## [1.3.16] — 2026-04-27@@ -25,7 +36,6 @@ Versioning follows [Semantic Versioning](https://semver.org/).### Fixed- **Lambda 250 MB unzipped-size limit was not enforced** — `CreateFunction` / `UpdateFunctionCode` / `PublishLayerVersion` accepted oversize zips and failed only at invocation time. All three now reject up-front with `InvalidParameterValueException`, matching AWS.- **S3 with `S3_PERSIST=1`: versioned object bodies capped at 10 MB and `GetObject(VersionId)` returned 500 for larger multipart uploads** — bodies now persist to disk (in-memory record drops the body, on-demand reads stream back), versioned reads return the persisted bytes, and disk writes go through atomic `tmp+rename` with mode `0o600` / dir `0o700` plus a path-traversal guard that rejects keys resolving outside `S3_DATA_DIR`.-- **CloudFormation `AWS::Lambda::Function` never fetched S3 code** — `_lambda_create` stored `Code.S3Bucket` / `Code.S3Key` as metadata but never resolved them against the in-memory S3 service, so every CFN-deployed S3-backed Lambda had `code_zip = None` and failed to invoke. Inline `ZipFile` was unaffected; everything else broken. Provisioner now fetches the bytes via the standard Lambda S3 helper.- **Persisted Cognito hosted-UI / federation `_auth_codes` lost across warm-boot** — `_auth_codes` had a 5-minute TTL but was declared "ephemeral, not persisted", so any in-flight hosted-UI sign-in straddling a warm-boot was silently invalidated. Now wired into `get_state` / `restore_state` so codes survive a restart up to their normal TTL. Plain-dict choice (no `AccountScopedDict`) preserved with a corrected rationale: none of the OAuth2 endpoints carry SigV4, so wrapping in `AccountScopedDict` would be functionally equivalent. Contributed by @bognari.- **`PERSIST_STATE=1`: twelve mutated state dicts were silently dropped on warm-boot.** Five wired in by @bognari (`secretsmanager._resource_policies`, `kinesis._consumers`, `ecs._attributes`, `sns._platform_applications`, `sns._platform_endpoints`) — without these, `aws_secretsmanager_secret_policy`, `aws_kinesis_stream_consumer`, ECS PutAttributes, and mobile-push topology silently disappeared on restart. Plus `cloudwatch_logs._destinations` / `_metric_filters` / `_queries` (also @bognari) — log-destinations and metric filters wiped on restart. Plus the seven follow-ups for the same bug family: `sqs._queue_name_to_url` (snapshotted via `dict(asd)` instead of `copy.deepcopy`, dropping every non-current-tenant mapping), `eventbridge._event_bus_policies` / `_connections` / `_api_destinations` (every `aws_cloudwatch_event_connection` and `aws_cloudwatch_event_api_destination` lost), `ssm._parameter_history` and `_tags` (`GetParameterHistory` returned empty after warm-boot), and `lambda_svc._kinesis_positions` / `_dynamodb_stream_positions` (every restart replayed event-source-mapping streams from `StartingPosition`, a real at-least-once-delivery violation).- **Persisted services failed to restore on startup for autoscaling / backup / eks / scheduler / pipes** — these five services declared `restore_state` but never invoked it on import, so warm-boots came up with empty state regardless of `PERSIST_STATE=1`. Wired in. Contributed by @bognari.diff --git a/README.md b/README.mdindex 3d9484f2..55849ec1 100644--- a/README.md+++ b/README.md@@ -49,6 +49,11 @@ docker run -p 4566:4566 ministackorg/ministack# Option 2b: Docker Hub with real infrastructure (RDS, ECS, Lambda containers)docker run -p 4566:4566 -v /var/run/docker.sock:/var/run/docker.sock ministackorg/ministack+# Option 2c: Full image — Debian/glibc base with DuckDB (Athena), psycopg2, pymysql.+# Larger (~360 MB vs ~110 MB) but enables Athena and native PostgreSQL/MySQL drivers+# that don't ship musllinux wheels. Reports `edition: full` on /_ministack/health.+docker run -p 4566:4566 ministackorg/ministack:full+# Option 3: Clone and buildgit clone https://github.com/ministackorg/ministackcd ministackdiff --git a/pyproject.toml b/pyproject.tomlindex 0c844584..5eba5cb4 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"[project]name = "ministack"-version = "1.3.16"+version = "1.3.17"description = "Free, open-source local AWS emulator — drop-in LocalStack replacement"readme = "README.md"license = { file = "LICENSE" }