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:8000but the emulator isn't up on that port (see connection refused). - Wrong endpoint URL — a typo, wrong port, or
httpswhere the local emulator serveshttp. - 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,
localhostis the container itself, not the host or the DynamoDB Local service.
How to fix it
- Confirm what's listening at the endpoint:
curl http://localhost:8000 # DynamoDB Local answers with a small response - Fix the endpoint URL — correct host, port (
8000by default), and scheme (httpfor Local). - Check the region spelling for real AWS, and make sure you have a network route (VPC endpoint / security group rules allow DynamoDB).
- In Docker, use the service name or
host.docker.internalinstead oflocalhost. - Talking to real AWS? Drop the
--endpoint-urloverride entirely and let botocore build the correct regional endpoint.
Related errors
- Could not connect to DynamoDB Local (ECONNREFUSED) — the Node/JS equivalent of a refused local connection.
- Missing region in config — no region, so the SDK can't build an endpoint at all.
- Learn: Running DynamoDB Local · Connecting to DynamoDB Local / LocalStack