Using DynamoDB with Node JS (source)
To run it:
- Make sure you have
npm
installed - Make sure AWS DynamoDB is running locally. For guide how to run DynamoDB on local environment, check out this page.
- Once you have DynamoDB currently running locally, run the code. For example, to create table, run
node MoviesCreateTable.js
.
To connect it to your own actual AWS account, modify the endpoint
:
AWS.config.update({endpoint: "https://dynamodb.aws-region.amazonaws.com"});
Also, make sure that your AWS has proper Access Key ID and Secret Access Key. For instruction, check out this guide.