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
fix(rds): implement DescribeDBClusterSnapshotAttributes (#1933)
Jeff Heller125c84517a40
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e0a716ff..d1c13621 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -9,6 +9,7 @@ Versioning follows [Semantic Versioning](https://semver.org/).### Fixed+- **RDS — `DescribeDBClusterSnapshotAttributes`** — was unimplemented (`InvalidAction: Unknown RDS action`), so Terraform's `aws_db_cluster_snapshot` resource failed on read (`reading RDS DB Cluster Snapshot … attribute`) after creating the snapshot. Returns the `restore` attribute with no shared accounts (the manual-snapshot default); `ModifyDBClusterSnapshotAttribute` is not implemented. Unknown snapshot ids answer `DBClusterSnapshotNotFoundFault`.- **Lambda — Docker executor under `USE_SSL=1` when MiniStack runs in a container** — the gateway certificate, CA bundle and Java truststore were bind-mounted into every Lambda container from MiniStack's own filesystem (`MINISTACK_SSL_CERT`, or the generated `ministack-tls/server.crt` under the temp directory), paths the host Docker daemon cannot see, so every invocation failed with `bind source path does not exist`. In a container they are now copied into the Lambda container, as function code already is.- **ECS — forced rolling deployments replace tasks and refresh images** — `UpdateService(forceNewDeployment=True)` replaces tasks even when the task definition is unchanged or omitted. Rolling deployments preserve scheduling limits, wait for replacement tasks to stabilize, and retain circuit-breaker rollback; zero-sized deployments drain old tasks and complete. Docker-backed services pin image digests per deployment, honor `versionConsistency: disabled`, and use Secrets Manager credentials for private registries. Tasks report resolved image digests and Fargate platform fields. Cached images remain usable on both launch types, including MiniStack ECR images, preserving MiniStack’s intentional offline fallback.- **IoT — mTLS trusts every registered device certificate** — the listener no longer fails the TLS handshake for an ACTIVE certificate whose CA was deactivated or deleted before its first connect, or that was registered without a CA; as on AWS, only the certificate's own status refuses it.diff --git a/ministack/services/rds.py b/ministack/services/rds.pyindex 20b6ca36..33569924 100644--- a/ministack/services/rds.py+++ b/ministack/services/rds.py@@ -14,7 +14,8 @@ Supports: CreateDBInstance, DeleteDBInstance, DescribeDBInstances, ModifyDBInstaDeleteDBClusterParameterGroup, DescribeDBClusterParameters,ModifyDBClusterParameterGroup, ResetDBClusterParameterGroup,CreateDBSnapshot, DeleteDBSnapshot, DescribeDBSnapshots,- CreateDBClusterSnapshot, DescribeDBClusterSnapshots, DeleteDBClusterSnapshot,+ CreateDBClusterSnapshot, DescribeDBClusterSnapshots, DescribeDBClusterSnapshotAttributes,+ DeleteDBClusterSnapshot,CreateOptionGroup, DeleteOptionGroup, DescribeOptionGroups, DescribeOptionGroupOptions,CreateDBInstanceReadReplica (stub), RestoreDBInstanceFromDBSnapshot (stub),ListTagsForResource, AddTagsToResource, RemoveTagsFromResource,@@ -6783,6 +6784,25 @@ def _describe_db_cluster_snapshots(p):f"<DescribeDBClusterSnapshotsResult><DBClusterSnapshots>{members}</DBClusterSnapshots></DescribeDBClusterSnapshotsResult>")+def _describe_db_cluster_snapshot_attributes(p):+ snap_id = _p(p, "DBClusterSnapshotIdentifier")+ if not snap_id or snap_id not in _db_cluster_snapshots:+ return _error("DBClusterSnapshotNotFoundFault",+ f"DB cluster snapshot {snap_id} not found.", 404)+ # Manual snapshots default to no shared accounts (empty "restore" values);+ # ModifyDBClusterSnapshotAttribute is not implemented, so this is always empty.+ result = (+ f"<DBClusterSnapshotAttributesResult>"+ f"<DBClusterSnapshotIdentifier>{_esc(snap_id)}</DBClusterSnapshotIdentifier>"+ f"<DBClusterSnapshotAttributes>"+ f"<DBClusterSnapshotAttribute><AttributeName>restore</AttributeName><AttributeValues></AttributeValues></DBClusterSnapshotAttribute>"+ f"</DBClusterSnapshotAttributes>"+ f"</DBClusterSnapshotAttributesResult>"+ )+ return _xml(200, "DescribeDBClusterSnapshotAttributesResponse",+ f"<DescribeDBClusterSnapshotAttributesResult>{result}</DescribeDBClusterSnapshotAttributesResult>")++def _delete_db_cluster_snapshot(p):snap_id = _p(p, "DBClusterSnapshotIdentifier")snap = _db_cluster_snapshots.pop(snap_id, None)@@ -11101,6 +11121,7 @@ _ACTION_MAP = {"DescribeDBSnapshots": _describe_db_snapshots,"CreateDBClusterSnapshot": _create_db_cluster_snapshot,"DescribeDBClusterSnapshots": _describe_db_cluster_snapshots,+ "DescribeDBClusterSnapshotAttributes": _describe_db_cluster_snapshot_attributes,"DeleteDBClusterSnapshot": _delete_db_cluster_snapshot,"CreateDBSubnetGroup": _create_subnet_group,"DeleteDBSubnetGroup": _delete_subnet_group,diff --git a/tests/test_rds.py b/tests/test_rds.pyindex 61bc5fd1..ce4768fe 100644--- a/tests/test_rds.py+++ b/tests/test_rds.py@@ -536,6 +536,31 @@ def test_rds_cluster_snapshot(rds):assert snaps[0]["DBClusterSnapshotIdentifier"] == "snap-cl-snap"rds.delete_db_cluster_snapshot(DBClusterSnapshotIdentifier="snap-cl-snap")+def test_rds_describe_db_cluster_snapshot_attributes(rds):+ rds.create_db_cluster(+ DBClusterIdentifier="snap-attr-cl",+ Engine="aurora-mysql",+ MasterUsername="admin",+ MasterUserPassword="password123",+ )+ rds.create_db_cluster_snapshot(+ DBClusterSnapshotIdentifier="snap-attr-snap",+ DBClusterIdentifier="snap-attr-cl",+ )+ resp = rds.describe_db_cluster_snapshot_attributes(DBClusterSnapshotIdentifier="snap-attr-snap")+ result = resp["DBClusterSnapshotAttributesResult"]+ assert result["DBClusterSnapshotIdentifier"] == "snap-attr-snap"+ attrs = result["DBClusterSnapshotAttributes"]+ assert len(attrs) >= 1+ restore = next(a for a in attrs if a["AttributeName"] == "restore")+ assert restore["AttributeValues"] == []+ rds.delete_db_cluster_snapshot(DBClusterSnapshotIdentifier="snap-attr-snap")++def test_rds_describe_db_cluster_snapshot_attributes_unknown_id(rds):+ with pytest.raises(ClientError) as exc_info:+ rds.describe_db_cluster_snapshot_attributes(DBClusterSnapshotIdentifier="no-such-snap-attr")+ assert exc_info.value.response["Error"]["Code"] == "DBClusterSnapshotNotFoundFault"+def test_rds_option_group(rds):rds.create_option_group(OptionGroupName="test-og",