Could not connect to the endpoint URL (DynamoDB)

TL;DR — botocore couldn't open a connection to the DynamoDB endpoint it resolved. Almost always a wrong --endpoint-url, DynamoDB Local not running, a bad/typo'd region producing a nonexistent hostname, or no network path (offline, VPC, security group). Point at a reachable endpoint and confirm something is listening.

What it means

botocore.exceptions.EndpointConnectionError: Could not connect to the
endpoint URL: "http://localhost:8000/"

boto3/botocore builds the DynamoDB endpoint URL from the region (or your explicit endpoint_url) and then fails to establish a TCP/HTTP connection to it. Unlike an auth or validation error, the request never reached a running service. It surfaces both against DynamoDB Local (emulator down / wrong port) and real AWS (bad region hostname or blocked network).

Why it happens

  • DynamoDB Local isn't running — you passed --endpoint-url http://localhost:8000 but the emulator isn't up on that port (see connection refused).
  • Wrong endpoint URL — a typo, wrong port, or https where the local emulator serves http.
  • Bad region — a misspelled region (us-east-11) resolves to a hostname that doesn't exist, so the connection can't be made.
  • No network path — offline, or DynamoDB traffic blocked by a VPC endpoint, security group, or network ACL.
  • Cross-container / cross-host — from inside Docker, localhost is the container itself, not the host or the DynamoDB Local service.

How to fix it

  1. Confirm what's listening at the endpoint:
    curl http://localhost:8000    # DynamoDB Local answers with a small response
  2. Fix the endpoint URL — correct host, port (8000 by default), and scheme (http for Local).
  3. Check the region spelling for real AWS, and make sure you have a network route (VPC endpoint / security group rules allow DynamoDB).
  4. In Docker, use the service name or host.docker.internal instead of localhost.
  5. Talking to real AWS? Drop the --endpoint-url override entirely and let botocore build the correct regional endpoint.

Trabalhe com o DynamoDB sem o Console

O DynoTable é um cliente desktop rápido para o DynamoDB — navegue pelas tabelas, execute consultas no estilo SQL e edite itens localmente.