Skip to content

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

release/v1.3.49 (#709)

Nahuel Nucera1962e2eb37ef
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 802f0e37..79cc05e9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,10 +7,19 @@ Versioning follows [Semantic Versioning](https://semver.org/).
---
-## [1.3.49] — 2026-05-24
+## [1.3.49] — 2026-05-25
### Added
-- **Amazon Inspector2** — new service emulator with 14 API operations: `Enable`, `Disable`, `ListFindings` (with filtering, sorting, pagination), `BatchGetFindingDetails`, `ListCoverage`, `ListCoverageStatistics`, `ListFindingAggregations`, `SearchVulnerabilities`, `TagResource`, `UntagResource`, `ListTagsForResource`, `CreateFilter`, `ListFilters`, `DeleteFilter`. Generates deterministic stub vulnerability findings for ECR container images, Lambda functions, and EC2 instances when enabled.
+- **Amazon Inspector2** — new service emulator with 14 API operations: `Enable`, `Disable`, `ListFindings` (with filtering, sorting, pagination), `BatchGetFindingDetails`, `ListCoverage`, `ListCoverageStatistics`, `ListFindingAggregations`, `SearchVulnerabilities`, `TagResource`, `UntagResource`, `ListTagsForResource`, `CreateFilter`, `ListFilters`, `DeleteFilter`. Generates deterministic stub vulnerability findings for ECR container images, Lambda functions, and EC2 instances when enabled. Contributed by @ry-allan.
+- **RDS auto-respawn at boot** — when `PERSIST_STATE=1` and an `rds.json` state file exists, MiniStack now eager-imports the RDS module at startup and respawns the Docker container for every persisted instance immediately, with no client API call required. Previously the module loaded lazily on the first RDS request, leaving the postgres/mysql container down until the user happened to call an `awslocal rds` operation. Zero idle cost when no RDS state file is present (the conditional skips the import entirely). Reported by @doodaz.
+- **Glue `CreateTable` persists `ViewOriginalText` / `ViewExpandedText`** — views created via `CreateTable` (the path used by Trino, Spark, and Athena) lost their SQL body because `_create_table` ignored both fields. `GetTable` now returns them, unblocking Trino's iceberg connector and other engines that fail with `viewOriginalText must be present`. Contributed by @yonatoasis.
+- **Glue `CreateTable` / `UpdateTable` persist `ViewDefinition` and `IsMultiDialectView`** — newer multi-dialect view clients (Spark 3.4+, Glue 4.0 jobs, Lake Formation cross-engine views) round-trip the full view definition instead of seeing it silently dropped on create.
+
+### Fixed
+- **AppSync Events resources persist across restarts with `PERSIST_STATE=1`** — Event APIs, channel namespaces, and API keys created against the AppSync Events endpoint (`/v2/apis`) were silently dropped on container restart because `appsync_events.json` was never written at shutdown. State is now saved and restored on every restart, matching the behavior of every other persisted service. Same fix covers a related class of restart drops for `apigateway_v1` on first boot and for services reached only via inter-service calls (Lambda-auto-created CloudWatch log groups, EventBridge targets fired by S3 notifications). Reported by @yaegassy.
+- **RDS respawn after restart no longer fails with `port is already allocated`** — restored DB instances tried to bind the engine's standard port (5432 for postgres, 3306 for mysql) on the host instead of the original docker host port, so every restart with persisted state left the instance in `failed`. The host port is now tracked separately on the instance, validated as free before reuse, and falls back to a fresh free port if something else has taken it. Stale `Created`-status containers from prior failed boots are force-removed before respawn so they don't hold the binding. Reported by @doodaz.
+- **CloudFront `ListDistributions` round-trips origin configuration** — `DistributionSummary` now includes `Origins` and `DefaultCacheBehavior` from the stored distribution config, so custom origins round-trip consistently across create, get, list, and update flows. Contributed by @CoffeeRaptor.
+- **CloudFront `DistributionSummary` emits all AWS-required fields** — `Aliases`, `CacheBehaviors`, `CustomErrorResponses`, `PriceClass`, `ViewerCertificate`, `Restrictions`, `WebACLId`, `HttpVersion`, `IsIPV6Enabled`, and `Staging` are now emitted alongside the fields above. When a field wasn't set on the original `CreateDistributionConfig`, ministack emits a minimal-but-valid default (empty `Quantity=0` containers, `CloudFrontDefaultCertificate=true`, `HttpVersion=http2`) so strict-parsing SDKs (Go v2, Java v2) don't reject the response.
---
@@ -20,7 +29,6 @@ Versioning follows [Semantic Versioning](https://semver.org/).
- **S3 `GetObjectAcl` and `PutObjectAcl`** — both `?acl` subresource operations are now implemented. `GetObjectAcl` returns the stored policy or, if none has been set, the AWS default of a single `FULL_CONTROL` Grant to the request's account-id owner. `PutObjectAcl` accepts either a canned ACL via the `x-amz-acl` header (`private`, `public-read`, `public-read-write`, `authenticated-read`, `aws-exec-read`, `bucket-owner-read`, `bucket-owner-full-control`) or a full `<AccessControlPolicy>` XML body; invalid canned values return `InvalidArgument` and malformed bodies return `MalformedACLError`. As with retention, legal-hold and bucket policies, the policy is stored and round-tripped but not enforced on the data plane. `NoSuchKey` returned for missing keys, matching the only error modeled in botocore. Reported by @smpial.
### Fixed
-- **CloudFront distribution origin configuration** — `ListDistributions` now includes origin configuration from the stored distribution config, so custom origins round-trip consistently across create, get, list, and update flows.
- **RDS persistence-restore module-import race** — the v1.3.47 restore-respawn threads called `_get_docker()` which was defined further down in the same module, so a thread reaching the lookup before the parser finished raised `NameError: name '_get_docker' is not defined` and stranded the restored instance in `creating`. The `load_state("rds")` block now runs at the bottom of the module, after every helper the restore threads can touch. Reported by @doodaz.
---
diff --git a/ministack/app.py b/ministack/app.py
index dbcf4d1e..a39eae28 100644
--- a/ministack/app.py
+++ b/ministack/app.py
@@ -1798,6 +1798,19 @@ def _load_persisted_state():
for svc_key in ("pipes", "ses_v2", "appsync_events", "apigateway_v1"):
_get_module(svc_key)
+ # RDS is intentionally NOT in the unconditional list above —
+ # eager-importing it for every user would pull in ~13 MB of module
+ # objects (and, lazily, the docker SDK) even on stacks that don't
+ # use RDS. Instead, only eager-import when a persisted state file
+ # exists: importing the module triggers its bottom-of-file
+ # `load_state("rds")` which spawns the respawn threads for every
+ # persisted instance. Without this, users have to make one client
+ # call after every restart to lazily trigger the import + respawn
+ # (#692 follow-up after doodaz's confirmation).
+ if load_state("rds"):
+ _get_module("rds")
+ logger.info("RDS: eager-loaded module to respawn persisted containers at boot")
+
async def _wait_for_port(port, timeout=30):
"""Wait until the server is accepting TCP connections."""
diff --git a/ministack/services/cloudfront.py b/ministack/services/cloudfront.py
index a0088a6d..2592f8bb 100644
--- a/ministack/services/cloudfront.py
+++ b/ministack/services/cloudfront.py
@@ -198,6 +198,32 @@ def _add_config_block(parent, config_el, tag):
_add_xml_block(parent, child)
+# Minimal empty XML for each REQUIRED-block field on DistributionSummary.
+# Real AWS emits these even when the distribution was created with nothing
+# in them; SDKs that strict-parse (Go v2, Java v2) reject responses that
+# omit required members.
+_EMPTY_SUMMARY_BLOCKS = {
+ "Aliases": "<Aliases><Quantity>0</Quantity></Aliases>",
+ "Origins": "<Origins><Quantity>0</Quantity></Origins>",
+ "CacheBehaviors": "<CacheBehaviors><Quantity>0</Quantity></CacheBehaviors>",
+ "CustomErrorResponses": "<CustomErrorResponses><Quantity>0</Quantity></CustomErrorResponses>",
+ "ViewerCertificate": "<ViewerCertificate><CloudFrontDefaultCertificate>true</CloudFrontDefaultCertificate><MinimumProtocolVersion>TLSv1</MinimumProtocolVersion><CertificateSource>cloudfront</CertificateSource></ViewerCertificate>",
+ "Restrictions": "<Restrictions><GeoRestriction><RestrictionType>none</RestrictionType><Quantity>0</Quantity></GeoRestriction></Restrictions>",
+ "DefaultCacheBehavior": "<DefaultCacheBehavior><TargetOriginId></TargetOriginId><ViewerProtocolPolicy>allow-all</ViewerProtocolPolicy></DefaultCacheBehavior>",
+}
+
+
+def _add_config_block_with_default(parent, config_el, tag):
+ """Like `_add_config_block` but emits a minimal-but-valid empty block
+ when the source config doesn't contain `tag` — keeps DistributionSummary
+ schema-complete for strict-parsing SDKs."""
+ child = _find(config_el, tag)
+ if child is not None:
+ _add_xml_block(parent, child)
+ elif tag in _EMPTY_SUMMARY_BLOCKS:
+ _add_xml_block(parent, fromstring(_EMPTY_SUMMARY_BLOCKS[tag]))
+
+
def _unwrap_distribution_create_xml(root_el):
"""Return ``(DistributionConfig element, Tags element or None)``.
@@ -852,11 +878,24 @@ def _list_distributions():
SubElement(ds, "Status").text = dist["Status"]
SubElement(ds, "LastModifiedTime").text = dist["LastModifiedTime"]
SubElement(ds, "DomainName").text = dist["DomainName"]
- SubElement(ds, "Enabled").text = str(dist["enabled"]).lower()
- SubElement(ds, "Comment").text = _text(fromstring(dist["config_xml"]), "Comment")
config_el = fromstring(dist["config_xml"])
- _add_config_block(ds, config_el, "Origins")
- _add_config_block(ds, config_el, "DefaultCacheBehavior")
+ # Field order matches real AWS DistributionSummary shape so
+ # SDKs that strict-parse (Go v2, Java v2) don't reject it.
+ # All 19 fields below are REQUIRED per botocore service-2.json.
+ _add_config_block_with_default(ds, config_el, "Aliases")
+ _add_config_block_with_default(ds, config_el, "Origins")
+ _add_config_block_with_default(ds, config_el, "DefaultCacheBehavior")
+ _add_config_block_with_default(ds, config_el, "CacheBehaviors")
+ _add_config_block_with_default(ds, config_el, "CustomErrorResponses")
+ SubElement(ds, "Comment").text = _text(config_el, "Comment") or ""
+ SubElement(ds, "PriceClass").text = _text(config_el, "PriceClass") or "PriceClass_All"
+ SubElement(ds, "Enabled").text = str(dist["enabled"]).lower()
+ _add_config_block_with_default(ds, config_el, "ViewerCertificate")
+ _add_config_block_with_default(ds, config_el, "Restrictions")
+ SubElement(ds, "WebACLId").text = _text(config_el, "WebACLId") or ""
+ SubElement(ds, "HttpVersion").text = _text(config_el, "HttpVersion") or "http2"
+ SubElement(ds, "IsIPV6Enabled").text = (_text(config_el, "IsIPV6Enabled") or "true").lower()
+ SubElement(ds, "Staging").text = str(dist.get("Staging", False)).lower()
return _xml_response("DistributionList", build)
diff --git a/ministack/services/glue.py b/ministack/services/glue.py
index 63087011..0ea0042c 100644
--- a/ministack/services/glue.py
+++ b/ministack/services/glue.py
@@ -269,6 +269,8 @@ def _create_table(data):
"Parameters": table_input.get("Parameters", {}),
"ViewOriginalText": table_input.get("ViewOriginalText"),
"ViewExpandedText": table_input.get("ViewExpandedText"),
+ "ViewDefinition": table_input.get("ViewDefinition"),
+ "IsMultiDialectView": table_input.get("IsMultiDialectView"),
"IsRegisteredWithLakeFormation": False,
"CatalogId": get_account_id(),
}
@@ -314,7 +316,8 @@ def _update_table(data):
if key not in _tables:
return error_response_json("EntityNotFoundException", f"Table {name} not found", 400)
safe_keys = {"Description", "Owner", "StorageDescriptor", "PartitionKeys",
- "TableType", "Parameters", "ViewOriginalText", "ViewExpandedText"}
+ "TableType", "Parameters", "ViewOriginalText", "ViewExpandedText",
+ "ViewDefinition", "IsMultiDialectView"}
for k in safe_keys:
if k in table_input:
_tables[key][k] = table_input[k]
diff --git a/ministack/services/rds.py b/ministack/services/rds.py
index cfc8562d..b3548efa 100644
--- a/ministack/services/rds.py
+++ b/ministack/services/rds.py
@@ -682,6 +682,7 @@ def _create_db_instance(p):
dbi_resource_id = f"db-{new_uuid().replace('-', '')[:20].upper()}"
endpoint_host = "localhost"
endpoint_port = port
+ host_port = None
docker_container_id = None
internal_host = None
internal_port = None
@@ -697,8 +698,11 @@ def _create_db_instance(p):
)
if image:
try:
- host_port = instance.get("_HostPort") or _next_port()
- instance["_HostPort"] = host_port
+ # Create path: the `instance` dict doesn't exist yet
+ # (it's built ~70 lines below). Allocate a fresh free port
+ # and we'll stamp `_HostPort` onto the instance dict at
+ # construction time so subsequent respawns reuse it.
+ host_port = _next_port()
endpoint_port = host_port
container_kwargs = dict(
image=image, detach=True,
@@ -776,6 +780,11 @@ def _create_db_instance(p):
"Port": endpoint_port,
"HostedZoneId": "Z2R2ITUGPM61AM",
},
+ # `_HostPort` is the actual docker host port; `Endpoint.Port` gets
+ # overwritten to the engine's container port later (5432 for
+ # postgres) to match real AWS, so respawn after restart needs the
+ # original host mapping stored separately (#692 follow-up).
+ "_HostPort": host_port,
"AllocatedStorage": allocated_storage,
"InstanceCreateTime": _format_time(now_ts),
"PreferredBackupWindow": "03:00-04:00",
diff --git a/pyproject.toml b/pyproject.toml
index 1d0b7d6e..235e4d53 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "ministack"
-version = "1.3.48"
+version = "1.3.49"
description = "Free, open-source local AWS emulator — drop-in LocalStack replacement"
readme = "README.md"
license = { file = "LICENSE" }