Repository: getmoto/moto

Issue:
'DynamoHandler' object has no attribute 'describe_endpoints'
## 'DynamoHandler' object has no attribute 'describe_endpoints'

Hi,

I'm trying to get a very basic test working, and am encountering the following issue:

`AttributeError: 'DynamoHandler' object has no attribute 'describe_endpoints'`

I can't identify what's wrong, but suspect an environment setup issue. Any help would be greatly appreciated.

### Environment Details:
MacOS Catalina 10.15.7
Setup using pipenv:
`pipenv install moto boto3 pytest`

```
python: v3.7.4
moto: v1.3.16
pytest: v6.2.2
boto3: v1.17.11
botocore: v1.20.11
```

### Example test :
test_moto.py
```
import pytest
from moto import mock_dynamodb2
import boto3

@pytest.fixture
def db_table(scope='session', autouse=True):

    mock = mock_dynamodb2()
    mock.start()
    dynamodb_mock = boto3.client('dynamodb')
    table_name = "table"

    table = dynamodb_mock.create_table(
        AttributeDefinitions=[{"AttributeName": "field_id", "AttributeType": "S"}],
        TableName=table_name,
        KeySchema=[{"AttributeName": "field_id", "KeyType": "HASH"}]
    )

    yield (dynamodb_mock, table_name)
    mock.stop()

def test_write(db_table):
    # do nothing for now
    assert True
```

### Invoked using:
`pytest`

### Full trace attached:
[exception_trace.log](https://github.com/spulec/moto/files/6011425/exception_trace.log)



Discussion:
Your test case succeeds for me using the [latest dev version](https://pypi.org/project/moto/1.3.17.dev280/).
Looks like you are calling the `describe_endpoints()` somewhere in your setup, it's just not part of the provided test case. 
Moto doesn't support that feature yet, so I'll mark this as an enhancement.

Resolving patch:
diff --git a/moto/dynamodb2/models/__init__.py b/moto/dynamodb2/models/__init__.py
--- a/moto/dynamodb2/models/__init__.py
+++ b/moto/dynamodb2/models/__init__.py
@@ -1085,6 +1085,14 @@ def create_table(self, name, **params):
     def delete_table(self, name):
         return self.tables.pop(name, None)
 
+    def describe_endpoints(self):
+        return [
+            {
+                "Address": "dynamodb.{}.amazonaws.com".format(self.region_name),
+                "CachePeriodInMinutes": 1440,
+            }
+        ]
+
     def tag_resource(self, table_arn, tags):
         for table in self.tables:
             if self.tables[table].table_arn == table_arn:
diff --git a/moto/dynamodb2/responses.py b/moto/dynamodb2/responses.py
--- a/moto/dynamodb2/responses.py
+++ b/moto/dynamodb2/responses.py
@@ -190,6 +190,10 @@ def delete_table(self):
             er = "com.amazonaws.dynamodb.v20111205#ResourceNotFoundException"
             return self.error(er, "Requested resource not found")
 
+    def describe_endpoints(self):
+        response = {"Endpoints": self.dynamodb_backend.describe_endpoints()}
+        return dynamo_json_dump(response)
+
     def tag_resource(self):
         table_arn = self.body["ResourceArn"]
         tags = self.body["Tags"]


Test patch:
diff --git a/tests/test_dynamodb2/test_dynamodb.py b/tests/test_dynamodb2/test_dynamodb.py
--- a/tests/test_dynamodb2/test_dynamodb.py
+++ b/tests/test_dynamodb2/test_dynamodb.py
@@ -6202,3 +6202,18 @@ def add_guids_to_table(table, num_items):
     set(restored_table_guids).should.equal(
         set(guids_original) | set(guids_added_after_restore)
     )
+
+
+@mock_dynamodb2
+@pytest.mark.parametrize("region", ["eu-central-1", "ap-south-1"])
+def test_describe_endpoints(region):
+    client = boto3.client("dynamodb", region)
+    res = client.describe_endpoints()["Endpoints"]
+    res.should.equal(
+        [
+            {
+                "Address": "dynamodb.{}.amazonaws.com".format(region),
+                "CachePeriodInMinutes": 1440,
+            },
+        ]
+    )