Create DynamoDB table

  1. Open DynamoDB console
  2. Click Create table

DynamoDBConsole

  1. Enter table name: Books
  • Enter parition key: id
  • Enter sort key: rv_id (review id), type is Number

CreateTable

  1. Scroll down to Table settings pattern, select Customize settings
  • Then, select On-demand
  • Click Create local Index

CreateTable

  1. Enter sort key: name
  • Click Create index

CreateTable

  1. Scroll down to the bottom, click Create table

CreateTable

So we have created the Books table with the Local secondary index of name-index

  1. To add data to the table, you can download the file below:
  1. Open this file, replace all <AWS-REGION> with the region where you created the S3 book-image-resize-store bucket, for example: ap-southeast-2

  2. Run the following command in the directory where you save the dynamoDB.json

aws dynamodb batch-write-item --request-items file://dynamoDB.json

BooksData