Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dynamo-client using local dynamodb client

I'm trying to connect to my DynamoDB local using the npm lib dynamo-client. I have the local DynamoDB client install and running as per:

  • https://aws.amazon.com/blogs/aws/dynamodb-local-for-desktop-development

However trying to connect to my localhost using:

db = dynamo.createClient('localhost', dbConf.credentials)
db.request('ListTables','', (e,r) -> console.log(e))

gives the following error:

e: {"code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect"}

like image 765
bryce Avatar asked Oct 16 '25 20:10

bryce


1 Answers

Needed to set the port and host in the options:

dbConf =
  region:
    region: 'localhost'
    host: 'localhost'
    port: 8000
  credentials:
    secretAccessKey: "KEY"
    accessKeyId: "ACCESSKEY"

db = dynamo.createClient(dbConf, dbConf.credentials)
like image 66
bryce Avatar answered Oct 18 '25 09:10

bryce



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!