From the course: AWS for Developers: DynamoDB

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating tables in DynamoDB using Node.js

Creating tables in DynamoDB using Node.js - Amazon Web Services (AWS) Tutorial

From the course: AWS for Developers: DynamoDB

Start my 1-month free trial

Creating tables in DynamoDB using Node.js

- [Instructor] Okay, with my local DynamoDB running in the background here from our script we created earlier, and I've opened up Visual Studio Code and I've gone to the three three exercise folder, I'm going to go ahead and create a new file in here called index.js. And in this file, we're going to create a table in our local instance of DynamoDB. I'll go ahead and do that now. First I'll go ahead and create a variable on line two called AWS and I'll require aws-sdk. Next I'll go ahead and configure the instance we want to use. And since we're not using the default and since we configured, I'm going to set the region to us west 2. You can use whatever you want there. I'll set my endpoint to http localhost 8000. Next I'll go ahead and create an instance of DynamoDB. AWS.DynamoDB. And let's go ahead and create the params for our new table. For my table name, I will call this NodeJsBaseballStats. That way we know this was created with NodeJS. I'll create my key schema, which is the same…

Contents