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(dynamodb): accept a table ARN in DescribeTable (#1826)
Samuel Hilsondf734ff2041b
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 07fde2da..537251bc 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -5,6 +5,12 @@ 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/).+## [Unreleased]++### Fixed++- **DynamoDB — `DescribeTable` accepts a table ARN** — `TableName` given as the table's ARN answered `ResourceNotFoundException`, where AWS accepts either form. It now resolves through the same ARN normalization the other table operations use, and an ARN from another account or region still answers `ResourceNotFoundException`. This unblocks OpenSearch Data Prepper's DynamoDB source, which always describes the table by ARN.+## [1.5.17] — 2026-09-25### Addeddiff --git a/ministack/services/dynamodb.py b/ministack/services/dynamodb.pyindex 6dae9a33..9087678c 100644--- a/ministack/services/dynamodb.py+++ b/ministack/services/dynamodb.py@@ -1275,7 +1275,7 @@ def _delete_table(data):def _describe_table(data):- name = data.get("TableName")+ name = _normalize_table_name(data.get("TableName"))if name not in _tables:return error_response_json("ResourceNotFoundException", f"Requested resource not found: Table: {name} not found", 400)return json_response({"Table": _table_description(name)})diff --git a/tests/test_dynamodb.py b/tests/test_dynamodb.pyindex e189664d..d25ec6db 100644--- a/tests/test_dynamodb.py+++ b/tests/test_dynamodb.py@@ -110,6 +110,30 @@ def test_dynamodb_tables_are_region_isolated_by_name(ddb):pass+def test_dynamodb_describe_table_accepts_table_arn(ddb):+ """DescribeTable accepts the table ARN in TableName, as AWS does; an ARN+ from another region still resolves to no table."""+ name = f"arn-describe-{_uuid_mod.uuid4().hex[:8]}"+ ddb.create_table(+ TableName=name,+ KeySchema=[{"AttributeName": "pk", "KeyType": "HASH"}],+ AttributeDefinitions=[{"AttributeName": "pk", "AttributeType": "S"}],+ BillingMode="PAY_PER_REQUEST",+ )+ try:+ arn = ddb.describe_table(TableName=name)["Table"]["TableArn"]+ assert ddb.describe_table(TableName=arn)["Table"]["TableName"] == name+ other_region_arn = arn.replace(":us-east-1:", ":eu-west-1:")+ with pytest.raises(ClientError) as e:+ ddb.describe_table(TableName=other_region_arn)+ assert e.value.response["Error"]["Code"] == "ResourceNotFoundException"+ finally:+ try:+ ddb.delete_table(TableName=name)+ except ClientError:+ pass++def test_dynamodb_same_name_table_metadata_is_region_scoped(ddb):east = _ddb_client("us-east-1")west = _ddb_client("us-west-2")