javascriptamazon-dynamodbdynamo-local

What should be the endpoint URL when not using the Dynamo DB local?


I am trying to fetch some Location Coordinates from a Dynamo DB table on a web app which are updated periodically by an android app. Since I am new to JavaScript, so I am following this tutorial.

But I don't want to use local version of Dynamo DB as my table is updated by an android app & that table is not a local one. So what should be the endpoint URL instead of http://localhost:8000.Please help me out with this.


Solution

  • You have to remove the following lines from the config definition:

    endpoint: 'http://localhost:8000',
    accessKeyId: "fakeMyKeyId",
    secretAccessKey: "fakeSecretAccessKey"
    

    After that you need to set up the AWS Credentials in your local machine. You can use this tutorial: https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html

    When the Credentials is valid, the sdk will use external tables. You can easily test the credentials with aws dynamodb list-tables command.