Repository: getmoto/moto (python)

Issue:
DynamoDB create_table fails with "Not yet implemented" error after updating boto3 to 1.37.0
## Issue

When attempting to mock dynamodb and call the `create_table` operation (or `CreateTable` depending on language), moto throws a "Not yet implemented" error

## Replication steps

Use `with mock_aws()` or `@mock_aws` on a test function. Create a dynamodb client and call the `create_table` operation.

## Additional Info

I am seeing the error when I upgrade from boto3 1.36.20 to boto3 1.37.0. So I'm assuming this is related to a breaking change between boto3 and moto, rather than a change in moto itself.

Pull request description:
DynamoDB: Support AccountMode
Fixes #8620 

Patch:
diff --git a/IMPLEMENTATION_COVERAGE.md b/IMPLEMENTATION_COVERAGE.md
index 3ce04cddd..980605ca3 100644
--- a/IMPLEMENTATION_COVERAGE.md
+++ b/IMPLEMENTATION_COVERAGE.md
@@ -1538,11 +1538,11 @@
 
 ## cognito-identity
 <details>
-<summary>39% implemented</summary>
+<summary>43% implemented</summary>
 
 - [X] create_identity_pool
 - [ ] delete_identities
-- [ ] delete_identity_pool
+- [X] delete_identity_pool
 - [ ] describe_identity
 - [X] describe_identity_pool
 - [X] get_credentials_for_identity
diff --git a/docs/docs/services/cognito-identity.rst b/docs/docs/services/cognito-identity.rst
index fb6042267..0ec822028 100644
--- a/docs/docs/services/cognito-identity.rst
+++ b/docs/docs/services/cognito-identity.rst
@@ -16,7 +16,7 @@ cognito-identity
 
 - [X] create_identity_pool
 - [ ] delete_identities
-- [ ] delete_identity_pool
+- [X] delete_identity_pool
 - [ ] describe_identity
 - [X] describe_identity_pool
 - [X] get_credentials_for_identity
diff --git a/moto/backend_index.py b/moto/backend_index.py
index 81bc73472..78a888e94 100644
--- a/moto/backend_index.py
+++ b/moto/backend_index.py
@@ -49,6 +49,7 @@ backend_url_patterns = [
     ("ds", re.compile("https?://ds\\.(.+)\\.amazonaws\\.com")),
     ("dsql", re.compile("https?://dsql\\.(.+)\\.api\\.aws")),
     ("dynamodb", re.compile("https?://dynamodb\\.(.+)\\.amazonaws\\.com")),
+    ("dynamodb", re.compile("https?://(.+).ddb\\.(.+)\\.amazonaws\\.com")),
     (
         "dynamodbstreams",
         re.compile("https?://streams\\.dynamodb\\.(.+)\\.amazonaws.com"),
diff --git a/moto/cognitoidentity/models.py b/moto/cognitoidentity/models.py
index a0a714cac..605214d1c 100644
--- a/moto/cognitoidentity/models.py
+++ b/moto/cognitoidentity/models.py
@@ -187,5 +187,10 @@ class CognitoIdentityBackend(BaseBackend):
             }
         )
 
+    def delete_identity_pool(self, identity_pool_id: str) -> None:
+        self.describe_identity_pool(identity_pool_id)
+
+        del self.identity_pools[identity_pool_id]
+
 
 cognitoidentity_backends = BackendDict(CognitoIdentityBackend, "cognito-identity")
diff --git a/moto/cognitoidentity/responses.py b/moto/cognitoidentity/responses.py
index 0a8dacba0..dac35caeb 100644
--- a/moto/cognitoidentity/responses.py
+++ b/moto/cognitoidentity/responses.py
@@ -84,3 +84,10 @@ class CognitoIdentityResponse(BaseResponse):
 
     def list_identity_pools(self) -> str:
         return self.backend.list_identity_pools()
+
+    def delete_identity_pool(self) -> str:
+        identity_pool_id = self._get_param("IdentityPoolId")
+        self.backend.delete_identity_pool(
+            identity_pool_id=identity_pool_id,
+        )
+        return ""
diff --git a/moto/dynamodb/urls.py b/moto/dynamodb/urls.py
index 59f70de77..a8c632e49 100644
--- a/moto/dynamodb/urls.py
+++ b/moto/dynamodb/urls.py
@@ -1,5 +1,8 @@
 from .responses import DynamoHandler
 
-url_bases = [r"https?://dynamodb\.(.+)\.amazonaws\.com"]
+url_bases = [
+    r"https?://dynamodb\.(.+)\.amazonaws\.com",
+    r"https?://(.+).ddb\.(.+)\.amazonaws\.com",
+]
 
 url_paths = {"{0}/": DynamoHandler.dispatch}
diff --git a/moto/guardduty/models.py b/moto/guardduty/models.py
index fb901ac7e..04ba54664 100644
--- a/moto/guardduty/models.py
+++ b/moto/guardduty/models.py
@@ -14,6 +14,9 @@ class GuardDutyBackend(BaseBackend):
         super().__init__(region_name, account_id)
         self.admin_account_ids: List[str] = []
         self.detectors: Dict[str, Detector] = {}
+        self.admin_accounts: Dict[
+            str, Detector
+        ] = {}  # Store admin accounts by detector_id
 
     def create_detector(
         self,
@@ -86,6 +89,20 @@ class GuardDutyBackend(BaseBackend):
             raise DetectorNotFoundException
         return self.detectors[detector_id]
 
+    def get_administrator_account(self, detector_id: str) -> Dict[str, Any]:
+        """Get administrator account details."""
+        self.get_detector(detector_id)
+
+        if not self.admin_account_ids:
+            return {}
+
+        return {
+            "Administrator": {
+                "AccountId": self.admin_account_ids[0],
+                "RelationshipStatus": "ENABLED",
+            }
+        }
+
     def get_filter(self, detector_id: str, filter_name: str) -> "Filter":
         detector = self.get_detector(detector_id)
         return detector.get_filter(filter_name)
diff --git a/moto/guardduty/responses.py b/moto/guardduty/responses.py
index 614e9add2..b7dc01639 100644
--- a/moto/guardduty/responses.py
+++ b/moto/guardduty/responses.py
@@ -114,3 +114,9 @@ class GuardDutyResponse(BaseResponse):
             rank=rank,
         )
         return json.dumps({"name": filter_name})
+
+    def get_administrator_account(self) -> str:
+        """Get administrator account details."""
+        detector_id = self.path.split("/")[-2]
+        result = self.guardduty_backend.get_administrator_account(detector_id)
+        return json.dumps(result)
diff --git a/moto/guardduty/urls.py b/moto/guardduty/urls.py
index 2b335cea0..9c20acad4 100644
--- a/moto/guardduty/urls.py
+++ b/moto/guardduty/urls.py
@@ -8,6 +8,7 @@ url_bases = [
 url_paths = {
     "{0}/detector$": GuardDutyResponse.dispatch,
     "{0}/detector/(?P<detector_id>[^/]+)$": GuardDutyResponse.dispatch,
+    "{0}/detector/(?P<detector_id>[^/]+)/administrator$": GuardDutyResponse.dispatch,
     "{0}/detector/(?P<detector_id>[^/]+)/filter$": GuardDutyResponse.dispatch,
     "{0}/detector/(?P<detector_id>[^/]+)/filter/(?P<filter_name>[^/]+)$": GuardDutyResponse.dispatch,
     "{0}/admin/enable$": GuardDutyResponse.dispatch,


Test patch:
diff --git a/tests/test_cognitoidentity/test_cognitoidentity.py b/tests/test_cognitoidentity/test_cognitoidentity.py
index cfa156add..cc1a52c65 100644
--- a/tests/test_cognitoidentity/test_cognitoidentity.py
+++ b/tests/test_cognitoidentity/test_cognitoidentity.py
@@ -256,3 +256,15 @@ def test_list_identity_pools():
     identity_data = conn.list_identity_pools(MaxResults=10)
     assert identity_pool_id == identity_data["IdentityPools"][0]["IdentityPoolId"]
     assert "test_identity_pool" == identity_data["IdentityPools"][0]["IdentityPoolName"]
+
+
+@mock_aws
+def test_delete_identity_pool():
+    conn = boto3.client("cognito-identity", region_name="ap-southeast-1")
+    identity_pool_id = conn.create_identity_pool(
+        IdentityPoolName="test_identity_pool", AllowUnauthenticatedIdentities=True
+    )["IdentityPoolId"]
+
+    assert len(conn.list_identity_pools(MaxResults=10)["IdentityPools"]) == 1
+    conn.delete_identity_pool(IdentityPoolId=identity_pool_id)
+    assert len(conn.list_identity_pools(MaxResults=10)["IdentityPools"]) == 0
diff --git a/tests/test_dynamodb/test_dynamodb_account_mode.py b/tests/test_dynamodb/test_dynamodb_account_mode.py
new file mode 100644
index 000000000..9d9289f10
--- /dev/null
+++ b/tests/test_dynamodb/test_dynamodb_account_mode.py
@@ -0,0 +1,26 @@
+import boto3
+import pytest
+from botocore.config import Config
+
+from moto import mock_aws
+from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID
+
+
+@mock_aws
+@pytest.mark.parametrize("endpoint_mode", ["disabled", "preferred", "required"])
+def test_dynamodb_with_account_id_routing(endpoint_mode):
+    endpoint_config = Config(account_id_endpoint_mode=endpoint_mode)
+    client = boto3.client(
+        "dynamodb",
+        aws_access_key_id="ACCESS_KEY",
+        aws_secret_access_key="SECRET_KEY",
+        aws_account_id=ACCOUNT_ID,
+        region_name="us-west-2",
+        config=endpoint_config,
+    )
+    client.create_table(
+        TableName="test",
+        KeySchema=[{"AttributeName": "id", "KeyType": "HASH"}],
+        AttributeDefinitions=[{"AttributeName": "id", "AttributeType": "S"}],
+        ProvisionedThroughput={"ReadCapacityUnits": 5, "WriteCapacityUnits": 5},
+    )
diff --git a/tests/test_guardduty/test_guardduty.py b/tests/test_guardduty/test_guardduty.py
index 4cd44688a..b0c626f5f 100644
--- a/tests/test_guardduty/test_guardduty.py
+++ b/tests/test_guardduty/test_guardduty.py
@@ -175,3 +175,35 @@ def test_delete_detector():
     )
 
     assert client.list_detectors()["DetectorIds"] == []
+
+
+@mock_aws
+def test_get_administrator_account():
+    guardduty_client = boto3.client("guardduty", region_name="us-east-1")
+
+    detector_response = guardduty_client.create_detector(Enable=True)
+    detector_id = detector_response["DetectorId"]
+
+    guardduty_client.enable_organization_admin_account(AdminAccountId="someaccount")
+
+    list_resp = guardduty_client.list_organization_admin_accounts()
+
+    assert list_resp["AdminAccounts"][0]["AdminAccountId"] == "someaccount"
+    assert list_resp["AdminAccounts"][0]["AdminStatus"] == "ENABLED"
+
+    resp = guardduty_client.get_administrator_account(DetectorId=detector_id)
+    assert resp["ResponseMetadata"]["HTTPStatusCode"] == 200
+
+
+@mock_aws
+def test_no_administrator_account():
+    guardduty_client = boto3.client("guardduty", region_name="us-east-1")
+
+    detector_response = guardduty_client.create_detector(Enable=True)
+    detector_id = detector_response["DetectorId"]
+    list_resp = guardduty_client.list_organization_admin_accounts()
+
+    resp = guardduty_client.get_administrator_account(DetectorId=detector_id)
+
+    assert "AdminAccountId" not in list_resp
+    assert resp["ResponseMetadata"]["HTTPStatusCode"] == 200