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

2

7

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.

Mannuela answered 2/4, 2019 at 9:30 Comment(0)
T
9

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.

Thaine answered 2/4, 2019 at 9:47 Comment(2)
Wow, just removing the endpoint credential in the code make it work for me. Though I didn't removed accessKeyId & secretAccessKey. Thanks a lot.Mannuela
Happy to hear :)Thaine
N
6

Most Amazon Web Services offer a Regional endpoint that you can use to make your requests. The general syntax of a Regional endpoint is as follows.

protocol://service-code.region-code.amazonaws.com

For Example:

Dynamodb: https://dynamodb.us-west-2.amazonaws.com

SNS: https://sns.us-east-1.amazonaws.com

From link here: https://docs.aws.amazon.com/general/latest/gr/rande.html

Nason answered 30/10, 2020 at 3:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.