Skip to content

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

fix: IAM/CloudFormation JSON protocol support, AutoScaling stubs (#198)

Nahuel Nucera076b8bc0a0e8
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6b2405bd..724cb8e6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,15 @@ Versioning follows [Semantic Versioning](https://semver.org/).
---
+## [1.1.55] — 2026-04-09
+
+### Fixed
+- **IAM/CloudFormation JSON protocol support** — IAM and CloudFormation now handle `AwsJson1_1` protocol requests (used by newer AWS SDK versions and CDK CLI). v1.1.54 added JSON protocol support for STS only, but some CDK/SDK versions also send IAM and CloudFormation requests via JSON protocol, causing "The security token included in the request is invalid" errors.
+- **CloudFormation AutoScaling stubs** — `AWS::AutoScaling::AutoScalingGroup`, `LaunchConfiguration`, `ScalingPolicy`, `LifecycleHook`, and `ScheduledAction` are now handled as no-ops, allowing CDK/CFN stacks with ASGs to deploy without failing. Reported by @titan1978
+- **README KMS table formatting** — KMS row was detached from the services table by a blank line, causing broken rendering.
+
+---
+
## [1.1.54] — 2026-04-08
### Added
diff --git a/README.md b/README.md
index 81a5dc99..e7055255 100644
--- a/README.md
+++ b/README.md
@@ -335,7 +335,6 @@ subnet = ec2.create_subnet(
| **API Gateway v2** | CreateApi, GetApi, GetApis, UpdateApi, DeleteApi, CreateRoute, GetRoute, GetRoutes, UpdateRoute, DeleteRoute, CreateIntegration, GetIntegration, GetIntegrations, UpdateIntegration, DeleteIntegration, CreateStage, GetStage, GetStages, UpdateStage, DeleteStage, CreateDeployment, GetDeployment, GetDeployments, DeleteDeployment, CreateAuthorizer, GetAuthorizer, GetAuthorizers, UpdateAuthorizer, DeleteAuthorizer, TagResource, UntagResource, GetTags | HTTP API (v2) protocol; Lambda proxy (AWS_PROXY) and HTTP proxy (HTTP_PROXY) integrations; data plane via `{apiId}.execute-api.localhost`; `{param}` and `{proxy+}` path matching; JWT/Lambda authorizer CRUD |
| **API Gateway v1** | CreateRestApi, GetRestApi, GetRestApis, UpdateRestApi, DeleteRestApi, CreateResource, GetResource, GetResources, UpdateResource, DeleteResource, PutMethod, GetMethod, DeleteMethod, UpdateMethod, PutMethodResponse, GetMethodResponse, DeleteMethodResponse, PutIntegration, GetIntegration, DeleteIntegration, UpdateIntegration, PutIntegrationResponse, GetIntegrationResponse, DeleteIntegrationResponse, CreateDeployment, GetDeployment, GetDeployments, UpdateDeployment, DeleteDeployment, CreateStage, GetStage, GetStages, UpdateStage, DeleteStage, CreateAuthorizer, GetAuthorizer, GetAuthorizers, UpdateAuthorizer, DeleteAuthorizer, CreateModel, GetModel, GetModels, DeleteModel, CreateApiKey, GetApiKey, GetApiKeys, UpdateApiKey, DeleteApiKey, CreateUsagePlan, GetUsagePlan, GetUsagePlans, UpdateUsagePlan, DeleteUsagePlan, CreateUsagePlanKey, GetUsagePlanKeys, DeleteUsagePlanKey, CreateDomainName, GetDomainName, GetDomainNames, DeleteDomainName, CreateBasePathMapping, GetBasePathMapping, GetBasePathMappings, DeleteBasePathMapping, TagResource, UntagResource, GetTags | REST API (v1) protocol; Lambda proxy format 1.0 (AWS_PROXY), HTTP proxy (HTTP_PROXY), MOCK integration; data plane via `{apiId}.execute-api.localhost`; resource tree with `{param}` and `{proxy+}` path matching; JSON Patch for all PATCH operations; state persistence |
| **ELBv2 / ALB** | CreateLoadBalancer, DescribeLoadBalancers, DeleteLoadBalancer, DescribeLoadBalancerAttributes, ModifyLoadBalancerAttributes, CreateTargetGroup, DescribeTargetGroups, ModifyTargetGroup, DeleteTargetGroup, DescribeTargetGroupAttributes, ModifyTargetGroupAttributes, CreateListener, DescribeListeners, ModifyListener, DeleteListener, CreateRule, DescribeRules, ModifyRule, DeleteRule, SetRulePriorities, RegisterTargets, DeregisterTargets, DescribeTargetHealth, AddTags, RemoveTags, DescribeTags | Control plane + data plane; ALB→Lambda live traffic routing; `path-pattern`, `host-header`, `http-method`, `query-string`, `http-header` rule conditions; `forward`, `redirect`, `fixed-response` actions; data plane via `{lb-name}.alb.localhost` Host header or `/_alb/{lb-name}/` path prefix |
-
| **KMS** | CreateKey, ListKeys, DescribeKey, GetPublicKey, Sign, Verify, Encrypt, Decrypt, GenerateDataKey, GenerateDataKeyWithoutPlaintext, CreateAlias, DeleteAlias, ListAliases, UpdateAlias, EnableKeyRotation, DisableKeyRotation, GetKeyRotationStatus, GetKeyPolicy, PutKeyPolicy, ListKeyPolicies, EnableKey, DisableKey, ScheduleKeyDeletion, CancelKeyDeletion, TagResource, UntagResource, ListResourceTags | 27 actions; RSA (2048/4096) and symmetric keys; PKCS1v15 and PSS signing; envelope encryption; alias resolution; key rotation; key policies; tags; enable/disable/schedule deletion; full Terraform `aws_kms_key` compatible; `cryptography` package included in Docker image |
### CloudFormation
diff --git a/ministack/services/cloudformation/__init__.py b/ministack/services/cloudformation/__init__.py
index 7279b540..18c7faf7 100644
--- a/ministack/services/cloudformation/__init__.py
+++ b/ministack/services/cloudformation/__init__.py
@@ -9,6 +9,7 @@ Supports: CreateStack, UpdateStack, DeleteStack, DescribeStacks, ListStacks,
Uses Query API (Action=...) with form-encoded body.
"""
+import json
import logging
import os
from urllib.parse import parse_qs
@@ -40,7 +41,21 @@ from .helpers import _p # noqa: E402
async def handle_request(method: str, path: str, headers: dict,
body: bytes, query_params: dict) -> tuple:
params = dict(query_params)
- if method == "POST" and body:
+ content_type = headers.get("content-type", "")
+ target = headers.get("x-amz-target", "")
+
+ # JSON protocol (newer SDKs): X-Amz-Target: CloudFormation_20100515.ActionName
+ if "amz-json" in content_type and target.startswith("CloudFormation_20100515."):
+ action_name = target.split(".")[-1]
+ params["Action"] = [action_name]
+ if body:
+ try:
+ json_body = json.loads(body)
+ for k, v in json_body.items():
+ params[k] = [str(v)] if not isinstance(v, list) else v
+ except (json.JSONDecodeError, TypeError):
+ pass
+ elif method == "POST" and body:
form_params = parse_qs(body.decode("utf-8", errors="replace"))
for k, v in form_params.items():
params[k] = v
diff --git a/ministack/services/iam_sts.py b/ministack/services/iam_sts.py
index b746d5a1..2670a3db 100644
--- a/ministack/services/iam_sts.py
+++ b/ministack/services/iam_sts.py
@@ -95,7 +95,21 @@ if _restored:
async def handle_iam_request(method, path, headers, body, query_params):
params = dict(query_params)
- if method == "POST" and body:
+ content_type = headers.get("content-type", "")
+ target = headers.get("x-amz-target", "")
+
+ # JSON protocol (newer SDKs): X-Amz-Target: IAMService.ActionName
+ if "amz-json" in content_type and "." in target:
+ action_name = target.split(".")[-1]
+ params["Action"] = [action_name]
+ if body:
+ try:
+ json_body = json.loads(body)
+ for k, v in json_body.items():
+ params[k] = [str(v)] if not isinstance(v, list) else v
+ except (json.JSONDecodeError, TypeError):
+ pass
+ elif method == "POST" and body:
for k, v in parse_qs(body.decode("utf-8", errors="replace")).items():
params[k] = v
diff --git a/pyproject.toml b/pyproject.toml
index c2ed06f2..548a45a5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "ministack"
-version = "1.1.54"
+version = "1.1.55"
description = "Free, open-source local AWS emulator — drop-in LocalStack replacement"
readme = "README.md"
license = { file = "LICENSE" }