Skip to content

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

release v1.4.15

Nahuel990169714ad09f2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 49c8cdc6..48d7388e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,7 +10,7 @@ Versioning follows [Semantic Versioning](https://semver.org/).
### Added
- **RDS — `ManageMasterUserPassword` wires Aurora clusters to Secrets Manager** — `CreateDBCluster(ManageMasterUserPassword=true)` previously ignored the flag: no secret was created, no `MasterUserSecret` was returned, and code paths that resolve database credentials from Secrets Manager (the common production pattern) could not be rehearsed locally. The flag now generates a random master password, stores it in MiniStack's own Secrets Manager as `{"username", "password"}` under the AWS naming convention (`rds!cluster-<uuid>`), and returns `MasterUserSecret` (`SecretArn`, `SecretStatus`, `KmsKeyId`) from create/describe/modify. `ModifyDBCluster(RotateMasterUserPassword=true, ApplyImmediately=true)` rotates the real database login through the same path as an explicit password change — including the pending-rotation behavior for stopped compute — and promotes the new credentials to `AWSCURRENT` (previous ones stay readable as `AWSPREVIOUS`); a rotation whose managed secret was deleted out from under RDS fails with `InvalidDBClusterStateFault` and flips `SecretStatus` to `impaired`, as on AWS. `DeleteDBCluster` deletes the managed secret with the cluster (and only when the delete actually succeeds). AWS-exact rejections: `ManageMasterUserPassword` + explicit `MasterUserPassword` at create, explicit password against a managed cluster, `RotateMasterUserPassword` without a managed secret or without `ApplyImmediately`, and explicit password + rotate flag in one request — validated before anything mutates. The RDS↔Secrets Manager seam is in-process and one-directional (rds → secretsmanager), reusing the emulator's existing stage-promotion and replica-sync internals. Contributed by @kiran01bm.
- **EventBridge — API destination targets are now invoked over HTTP on `PutEvents`** — API destinations and connections were control-plane stubs: a matching rule with an api-destination target logged "unsupported event target ARN" and dropped the event, so webhook-style pipelines (EventBridge → HTTPS endpoint) could not be tested locally. Matching events now POST (or the destination's configured method) to the `InvocationEndpoint` with the input-selected payload (`Input` / `InputPath` / `InputTransformer` apply as for other targets). Connection authorization is honored: `BASIC` populates `Authorization: Basic …`, `API_KEY` sends the configured header, and `OAUTH_CLIENT_CREDENTIALS` exchanges the client ID/secret at the authorization endpoint (`OAuthHttpParameters` merged in, `grant_type=client_credentials` defaulted), caches the token per connection and invalidates it when the connection is deleted, re-authorized, or deauthorized (a connection recreated under a reused name never inherits its predecessor's token), refreshes proactively when it expires within 60 seconds, and refreshes + retries once on a `401`/`407` response — matching documented AWS behavior. Connection `InvocationHttpParameters` and target `HttpParameters` are merged with connection values taking precedence (per the `HttpParameters` API reference), `PathParameterValues` populate `*` path wildcards, and body parameters fold into JSON-object bodies. Requests carry the AWS default headers (`User-Agent: Amazon/EventBridge/ApiDestinations` and `Range` non-overridable, `Content-Type` defaulting to `application/json; charset=utf-8`), strip the headers real EventBridge removes, and time out after 5 seconds (the documented maximum client execution timeout). Delivery runs on a background thread mirroring the SNS HTTP(S) path. Not modeled, mirroring the cross-region FailedInvocations policy: the 24h/185-attempt retry pipeline, `Retry-After`, DLQs, and `InvocationRateLimitPerSecond` — retryable statuses (`401`, `407`, `409`, `429`, `5xx`) are logged and dropped. Contributed by @t-rech.
-- **KMS — HMAC keys, `GenerateMac`, and `VerifyMac`** — the four HMAC key specs (`HMAC_224`/`HMAC_256`/`HMAC_384`/`HMAC_512`) with `KeyUsage=GENERATE_VERIFY_MAC`, RFC 2104 HMAC generation and constant-time verification (`KMSInvalidMacException` on mismatch), `MacAlgorithms` in the key metadata, and `DryRun`. HMAC keys are rejected by `Encrypt` / `Decrypt` / `Sign` / `Verify` / `GenerateDataKey*`, and the key-rotation operations (`EnableKeyRotation` / `DisableKeyRotation` / `GetKeyRotationStatus`) reject them with `UnsupportedOperationException`, matching AWS. Contributed by @nafdev.
+- **KMS — HMAC keys, `GenerateMac`, and `VerifyMac`** — the four HMAC key specs (`HMAC_224`/`HMAC_256`/`HMAC_384`/`HMAC_512`) with `KeyUsage=GENERATE_VERIFY_MAC`, RFC 2104 HMAC generation and constant-time verification (`KMSInvalidMacException` on mismatch), `MacAlgorithms` in the key metadata, and `DryRun`. HMAC keys are rejected by `Encrypt` / `Decrypt` / `Sign` / `Verify` / `GenerateDataKey*`, and automatic key rotation follows AWS: `EnableKeyRotation` and `DisableKeyRotation` reject them with `UnsupportedOperationException`, while `GetKeyRotationStatus` succeeds and reports `KeyRotationEnabled: false`. Contributed by @nafdev.
- **Lambda — `LAMBDA_KEEPALIVE_MS=0` forces a per-invocation cold start** — a LocalStack-compat lever (not an AWS behavior): for Docker RIE runtimes (Ruby/Java/.NET), `LAMBDA_KEEPALIVE_MS=0` tears the warm container down after each invocation so the next invoke re-runs INIT, giving deterministic cold-start isolation for test suites. Unset or any non-zero value keeps the warm-pool behavior. Reported by @mayankgupta57.
### Fixed
diff --git a/ministack/services/kms.py b/ministack/services/kms.py
index 3b3ddd6c..e768d530 100644
--- a/ministack/services/kms.py
+++ b/ministack/services/kms.py
@@ -1384,9 +1384,6 @@ def _get_key_rotation_status(data):
rec = _resolve_key(data.get("KeyId", ""))
if not rec:
return error_response_json("NotFoundException", f"Key {data.get('KeyId', '')} not found", 400)
- err = _reject_rotation_for_hmac(rec, "GetKeyRotationStatus")
- if err:
- return err
return json_response({
"KeyRotationEnabled": rec.get("KeyRotationEnabled", False),
"RotationPeriodInDays": rec.get("RotationPeriodInDays", 365),
diff --git a/tests/test_kms.py b/tests/test_kms.py
index a0151e23..033447f7 100644
--- a/tests/test_kms.py
+++ b/tests/test_kms.py
@@ -1720,9 +1720,10 @@ def test_kms_hmac_key_cannot_enable_rotation(kms_client):
kms_client.enable_key_rotation(KeyId=meta["KeyId"])
-def test_kms_hmac_key_rotation_reads_and_disable_are_no_ops(kms_client):
+def test_kms_hmac_key_disable_rotation_unsupported_but_status_reads_false(kms_client):
meta = _hmac_key(kms_client)
- assert kms_client.disable_key_rotation(KeyId=meta["KeyId"])
+ with pytest.raises(kms_client.exceptions.UnsupportedOperationException):
+ kms_client.disable_key_rotation(KeyId=meta["KeyId"])
status = kms_client.get_key_rotation_status(KeyId=meta["KeyId"])
assert status["KeyRotationEnabled"] is False