Create DynamoDB table
- Open DynamoDB console
- Click Create table
- Enter table name: Books
- Enter parition key:
id
- Enter sort key:
rv_id
(review id), type is Number
- Scroll down to Table settings pattern, select Customize settings
- Then, select On-demand
- Click Create local Index
- Enter sort key: name
- Scroll down to the bottom, click Create table
So we have created the Books table with the Local secondary index of name-index
- To add data to the table, you can download the file below:
dynamoDB.json
(4 ko)
-
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
-
Run the following command in the directory where you save the dynamoDB.json
aws dynamodb batch-write-item --request-items file://dynamoDB.json