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.29 (#580)
Nahuel Nuceraa148ccab556b
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex ab2fdc7b..28600e73 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -5,15 +5,19 @@ All notable changes to MiniStack will be documented here.Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).Versioning follows [Semantic Versioning](https://semver.org/).--- **Step Functions `aws-sdk:ec2` security group compatibility** — `CreateSecurityGroup` now maps the SDK `Description` parameter to EC2's query-wire `GroupDescription` while preserving `VpcId`, and `DescribeSecurityGroups` now sends EC2-shaped filters (`Filter.1.Value.1`) instead of the generic `member.N` form. The Step Functions XML adapter also returns `SecurityGroups` instead of raw `SecurityGroupInfo`, matching AWS SDK output.----## [Unreleased]+## [1.3.29] — 2026-05-06++### Added+- **EC2 `DescribeVpcEndpointServices`** — returns the standard catalog of 2 Gateway services (`s3`, `dynamodb`) and 17 Interface PrivateLink services with region-templated DNS names and stable per-service IDs. `ServiceNames`, `service-name`, and `service-type` filters supported. Reported by @svenikea.+- **DynamoDB legacy `AttributeUpdates`** — `UpdateItem` now applies the pre-expression parameter with `PUT` (default), `DELETE` (full removal or set subtract), and `ADD` (numeric increment or set union) actions. Mutually exclusive with `UpdateExpression`. .NET AWS SDK upserts (`UpdateItem` under the hood) were silently dropping all non-key fields. Reported by @gnjack.### Fixed-- **SQS `ReceiveMessage` honors `MessageSystemAttributeNames`** — only the legacy `AttributeNames` / `SystemAttributeNames` request fields were read; the AWS Java SDK v2 (and any client using the modern, non-deprecated request shape) sends `MessageSystemAttributeNames`, so `Attributes` came back empty even when the client requested `All`. Broke `ApproximateReceiveCount`-based redelivery detection and DLQ logic for SDK v2 consumers.-- **CFN `AWS::SNS::Subscription` honors `RawMessageDelivery`** — the CloudFormation provisioner read only `FilterPolicyScope` and `FilterPolicy` from the resource properties, silently defaulting subscriptions to `RawMessageDelivery=false` even when the template explicitly set it to `true`. Consumers received SNS-wrapped envelope JSON instead of the raw message, breaking attribute-based routing for any consumer that reads SQS-level `MessageAttributes`.+- **Step Functions `aws-sdk:ec2` security group compatibility** — `CreateSecurityGroup` now maps SDK `Description` to wire `GroupDescription`, `DescribeSecurityGroups` sends EC2-shaped filters (`Filter.1.Value.1` instead of `member.N`), and the XML adapter returns `SecurityGroups` rather than raw `SecurityGroupInfo`. Contributed by @jayjanssen.+- **Step Functions `aws-sdk:s3` integration** — S3 was tagged as `rest`-protocol with no dispatcher; every call failed with `States.Runtime`. New REST-XML dispatcher covers `ListBuckets`, `CreateBucket`, `DeleteBucket`, `HeadBucket`, `GetBucketVersioning`, `ListObjectsV2`, `ListObjects`, `HeadObject`, `CopyObject`, `DeleteObject`, `GetObjectTagging`, `PutObjectTagging`. `GetObject`/`PutObject` deferred to Phase 2. Reported by @LeTrungNguyen1703.+- **SQS `ReceiveMessage` honors `MessageSystemAttributeNames`** — only the deprecated `AttributeNames` was read, so AWS SDK v2 (Java/Kotlin) consumers got empty `Attributes` and broken `ApproximateReceiveCount`-based redelivery detection. Contributed by @joaomena.+- **CFN `AWS::SNS::Subscription` honors `RawMessageDelivery`** — the provisioner silently defaulted to `false` even when templates set `true`, so consumers got SNS-wrapped envelopes instead of raw payloads. Contributed by @joaomena.---@@ -838,9 +842,6 @@ These services stored per-tenant data in plain `dict` / `list`, so `List*` / `De- **Dynamic RDS storage** — new `RDS_PERSIST=1` env var switches database containers from fixed-size tmpfs to Docker named volumes for auto-growing persistent storage. Default (`RDS_PERSIST=0`) remains ephemeral tmpfs for CI/CD. Reported by @macario1983 (#248).- **Dual Docker Hub publishing** — Docker images now publish to both `nahuelnucera/ministack` and `ministackorg/ministack` on tag push.-### Fixed-- **Step Functions `aws-sdk:s3` integration** — `arn:aws:states:::aws-sdk:s3:listObjectsV2`, `:copyObject`, and other S3 control-plane operations now dispatch correctly. Previously, S3 was tagged as `rest`-protocol with no dispatcher and every call failed with `States.Runtime`: "aws-sdk integration for rest-protocol service 's3' is not yet implemented". A REST-XML dispatcher now drives a hand-tabled spec for list/head/copy/delete/tagging operations, mapping each `Parameters` field to its botocore-modelled URI/querystring/header location and returning XML responses normalised to the SFN PascalCase convention. Reported by @LeTrungNguyen1703 (#573). Phase 1 covers `ListBuckets`, `CreateBucket`, `DeleteBucket`, `HeadBucket`, `GetBucketVersioning`, `ListObjectsV2`, `ListObjects`, `HeadObject`, `CopyObject`, `DeleteObject`, `GetObjectTagging`, `PutObjectTagging`. `GetObject`/`PutObject` (Body-bearing operations) deferred to Phase 2.----## [1.2.0] — 2026-04-11diff --git a/ministack/services/dynamodb.py b/ministack/services/dynamodb.pyindex 552271c3..e6a0131f 100644--- a/ministack/services/dynamodb.py+++ b/ministack/services/dynamodb.py@@ -669,7 +669,10 @@ def _update_item(data):if update_expr:item = _apply_update_expression(item, update_expr, eav, ean)elif attribute_updates:- item = _apply_attribute_updates(item, attribute_updates)+ try:+ item = _apply_attribute_updates(item, attribute_updates)+ except _AttributeUpdatesValidationError as exc:+ return error_response_json("ValidationException", str(exc), 400)table["items"][pk_val][sk_val] = item_update_counts(table)@@ -2703,6 +2706,18 @@ def _evaluate_expected(item, expected, conditional_operator="AND"):return all(results)+_SET_TYPES = ("SS", "NS", "BS")+++class _AttributeUpdatesValidationError(Exception):+ """Raised when AttributeUpdates contains an invalid action/type combination.++ Real DynamoDB rejects DELETE-with-Value where the existing attribute is not a+ set, and ADD where the existing attribute (or the supplied value) is not a+ Number or set type. The caller translates this to a ValidationException.+ """++def _apply_attribute_updates(item, attribute_updates):"""Apply legacy ``AttributeUpdates`` to an item.@@ -2723,34 +2738,49 @@ def _apply_attribute_updates(item, attribute_updates):# No value → remove the attribute entirelyitem.pop(attr_name, None)else:- # Value provided → subtract from a set+ value_set_type = next((t for t in _SET_TYPES if t in value), None)+ if value_set_type is None:+ raise _AttributeUpdatesValidationError(+ "One or more parameter values were invalid: "+ "Action DELETE is not supported for the type of value "+ f"provided for attribute {attr_name}"+ )existing = item.get(attr_name)- if existing:- for set_type in ("SS", "NS", "BS"):- if set_type in value and set_type in existing:- remaining = [v for v in existing[set_type] if v not in set(value[set_type])]- if remaining:- item[attr_name] = {set_type: remaining}- else:- item.pop(attr_name, None)- break+ if existing is None:+ continue+ if value_set_type not in existing:+ raise _AttributeUpdatesValidationError(+ "One or more parameter values were invalid: "+ f"Type mismatch for attribute {attr_name}"+ )+ remaining = [v for v in existing[value_set_type] if v not in set(value[value_set_type])]+ if remaining:+ item[attr_name] = {value_set_type: remaining}+ else:+ item.pop(attr_name, None)elif action == "ADD":if value is None:continueexisting = item.get(attr_name)- if "N" in value:+ value_type = next(iter(value.keys()), None)+ if value_type not in ("N",) + _SET_TYPES:+ raise _AttributeUpdatesValidationError(+ "One or more parameter values were invalid: "+ "Action ADD is only supported for Number and set types "+ f"for attribute {attr_name}"+ )+ if existing is not None and value_type not in existing:+ raise _AttributeUpdatesValidationError(+ "One or more parameter values were invalid: "+ f"Type mismatch for attribute {attr_name}"+ )+ if value_type == "N":inc = Decimal(value["N"])cur = Decimal(existing["N"]) if existing and "N" in existing else Decimal(0)item[attr_name] = {"N": str(cur + inc)}- elif "SS" in value:- cur = set(existing["SS"]) if existing and "SS" in existing else set()- item[attr_name] = {"SS": sorted(cur | set(value["SS"]))}- elif "NS" in value:- cur = set(existing["NS"]) if existing and "NS" in existing else set()- item[attr_name] = {"NS": sorted(cur | set(value["NS"]))}- elif "BS" in value:- cur = set(existing["BS"]) if existing and "BS" in existing else set()- item[attr_name] = {"BS": sorted(cur | set(value["BS"]))}+ else:+ cur = set(existing[value_type]) if existing and value_type in existing else set()+ item[attr_name] = {value_type: sorted(cur | set(value[value_type]))}return itemdiff --git a/ministack/services/ec2.py b/ministack/services/ec2.pyindex 6e63bd5d..7a7ff770 100644--- a/ministack/services/ec2.py+++ b/ministack/services/ec2.py@@ -55,6 +55,7 @@ Supports:"""import copy+import hashlibimport loggingimport osimport random@@ -1518,7 +1519,7 @@ def _describe_vpc_endpoint_services(p):private_dns = f"<privateDnsName>{short}.{region}.amazonaws.com</privateDnsName>"detail_items.append(f"""<item><serviceName>{name}</serviceName>- <serviceId>vpce-svc-{abs(hash(name)) & 0xffffffffffff:012x}</serviceId>+ <serviceId>vpce-svc-{hashlib.sha256(name.encode()).hexdigest()[:12]}</serviceId><serviceType><item><serviceType>{stype}</serviceType></item></serviceType><availabilityZoneSet>{az_items}</availabilityZoneSet><owner>amazon</owner>diff --git a/ministack/services/sqs.py b/ministack/services/sqs.pyindex c5b7f87d..09f27d4b 100644--- a/ministack/services/sqs.py+++ b/ministack/services/sqs.py@@ -366,8 +366,7 @@ async def _act_receive_message(data: dict, qurl: str) -> dict:or q["attributes"].get("ReceiveMessageWaitTimeSeconds", "0"))attr_names = (data.get("AttributeNames")- or data.get("MessageSystemAttributeNames")- or data.get("SystemAttributeNames") or [])+ or data.get("MessageSystemAttributeNames") or [])msg_attr_names = data.get("MessageAttributeNames") or []deadline = time.time() + waitdiff --git a/pyproject.toml b/pyproject.tomlindex 9c6258bc..b7c67121 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"[project]name = "ministack"-version = "1.3.28"+version = "1.3.29"description = "Free, open-source local AWS emulator — drop-in LocalStack replacement"readme = "README.md"license = { file = "LICENSE" }diff --git a/tests/test_dynamodb.py b/tests/test_dynamodb.pyindex f962ae2e..d584b53d 100644--- a/tests/test_dynamodb.py+++ b/tests/test_dynamodb.py@@ -2493,3 +2493,43 @@ def test_dynamodb_attribute_updates_default_action_is_put(ddb):assert item["name"] == {"S": "alice"}+def test_dynamodb_attribute_updates_delete_with_value_on_non_set_raises(ddb):+ """DELETE with a Value where the existing attribute is not a set must fail."""+ table = f"t_attr_upd_del_invalid_{_uuid_mod.uuid4().hex[:8]}"+ ddb.create_table(+ TableName=table,+ KeySchema=[{"AttributeName": "pk", "KeyType": "HASH"}],+ AttributeDefinitions=[{"AttributeName": "pk", "AttributeType": "S"}],+ BillingMode="PAY_PER_REQUEST",+ )+ ddb.put_item(TableName=table, Item={"pk": {"S": "k1"}, "name": {"S": "alice"}})++ with pytest.raises(ClientError) as exc_info:+ ddb.update_item(+ TableName=table,+ Key={"pk": {"S": "k1"}},+ AttributeUpdates={"name": {"Action": "DELETE", "Value": {"SS": ["x"]}}},+ )+ assert exc_info.value.response["Error"]["Code"] == "ValidationException"+++def test_dynamodb_attribute_updates_add_on_string_attribute_raises(ddb):+ """ADD applied to an existing String attribute must fail (Number/set only)."""+ table = f"t_attr_upd_add_invalid_{_uuid_mod.uuid4().hex[:8]}"+ ddb.create_table(+ TableName=table,+ KeySchema=[{"AttributeName": "pk", "KeyType": "HASH"}],+ AttributeDefinitions=[{"AttributeName": "pk", "AttributeType": "S"}],+ BillingMode="PAY_PER_REQUEST",+ )+ ddb.put_item(TableName=table, Item={"pk": {"S": "k1"}, "name": {"S": "alice"}})++ with pytest.raises(ClientError) as exc_info:+ ddb.update_item(+ TableName=table,+ Key={"pk": {"S": "k1"}},+ AttributeUpdates={"name": {"Action": "ADD", "Value": {"N": "1"}}},+ )+ assert exc_info.value.response["Error"]["Code"] == "ValidationException"++