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