Cannot connect to serverless-dynamodb-local

Hi I installed serverless-dynamodb-local, but I cannot connect to the my local dynamodb instance.
When I start sls I get
sls offline start --noTimeout --httpPort 4000 --sharedDb
Dynamodb Local Started, Visit:xxx://localhost:8000/shell
Serverless: DynamoDB - created table Fact
offline: Starting Offline: dev/us-east-1.
offline: Offline [http for lambda] listening on xxx://localhost:3002
offline: Function names exposed for local invocation by aws-sdk:
I can access http://localhost:8000/shell and i see that it is running.
I can do telnet to localhost 8000.

I tried to connect with
dynamodb = boto3.resource('dynamodb',
            region_name='localhost',
            aws_access_key_id="test_id",
            aws_secret_access_key="my_secret", 
            endpoint_url="http://localhost:8000")

I do not use access or secret i get that credentials cannot be found.
So i added those and I get
[ERROR] EndpointConnectionError: Could not connect to the endpoint URL: “xxx://localhost:8000/”

I added serverless-python-requirements recetnly but it didnt help either. This is my serverless.yml file:

service: pala-backend

frameworkVersion: '2'

plugins:
  - serverless-offline
  - serverless-dynamodb-local
  - serverless-python-requirements

provider:
  name: aws
  runtime: python3.8

functions:
  checkImage:
    handler: handler.check_image
    events:
      - http:
          path: check
          method: post
  

custom:
  serverless-offline:
    noPrependStageInUrl: true
    useDocker: true
  dynamodb:
    stages:
      - dev
    start:
      port: 8000
      inMemory: true
      migrate: true
  pythonRequirements:
    dockerizePip: non-linux

I’m having the same exact problem @jdc18. Did you ever find a solution?

@jdc18 - I found a solution for my use case. I am running serverless-offline with the setting useDocker: True. Because my handler(s) run in Docker, I needed to use the special DNS name that allows the container access to my local network.

client = boto3.resource(
    'dynamodb',
    region_name='localhost',
    endpoint_url='http://host.docker.internal:8000'
)