gadelkareem / sails-dynamodb

Amazon DynamoDB adapter for Waterline / Sails.js
http://sailsjs.org
46 stars 22 forks source link

Connect to local Dynamo #37

Closed liftyourgame closed 6 years ago

liftyourgame commented 7 years ago

How do a configure this module to connect to a local dynamodb instead of AWS?

ferrants commented 7 years ago

@liftyourgame, I see your comment on issue #14 , making comments here.

I used the DynamoDBLocal.jar found here: https://aws.amazon.com/blogs/aws/dynamodb-local-for-desktop-development/ to get DynamoDb running locally.

Then, for my local environment for sails, I specified this in my local.js:

connections: {
    dynamodb: {
      endPoint: "http://localhost:8000",
      accessKeyId: "someaccesskey",
      secretAccessKey: "somesecretkey"
    }
  },

note, that is my real copied setup, I believe that I found that the access and secret keys had to be specified, even if the values were bogus.

ggarcia92 commented 6 years ago

I also used DynamoDBLocal.jar and this configuration works for me:

dynamoDb: {
    adapter: "sails-dynamodb",
    accessKeyId: 'abcde',
    secretAccessKey: 'abcde',
    region: "us-west-1",
    endPoint: "http://localhost:8000", // Optional: add for DynamoDB local
  },

If you already solve this problem please close it. Greetings