0

I'm doing:

  AWS.config.update({ accessKeyId: process.env['AWS_ACCESS_KEY'], secretAccessKey: process.env['AWS_SECRET_KEY'] })
  const dynamoClient = new DynamoDB.DocumentClient()
  console.log(dynamoClient)

but it gives:

...
    endpoint: Endpoint {
      protocol: 'https:',
      host: 'dynamodb.undefined.amazonaws.com',
      port: 443,
      hostname: 'dynamodb.undefined.amazonaws.com',
      pathname: '/',
      path: '/',
      href: 'https://dynamodb.undefined.amazonaws.com/'
    }
...

Where do I get (and specify) my endpoint?

3
  • Did you try to add the region as well? Commented Jun 9, 2020 at 13:18
  • where would I specify that? Commented Jun 9, 2020 at 13:25
  • on the aws sdk initialization Commented Jun 9, 2020 at 13:39

1 Answer 1

1

Go here for a bunch of great Node.js examples of working with DynamoDB. If what you are looking for is not there, please let me know.

Sign up to request clarification or add additional context in comments.

3 Comments

Do I need to define a schema ahead of time? I get The provided key element does not match the schema
You need to at least define the primary key when you create a DynamoDB table. That primary key can be either just a partition key or it can be a combination of the partition and sort keys. It all depends on the access patterns you plan to support with the table.
Follow up if you have a minute: stackoverflow.com/questions/62285490/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.