Menu
Amazon DynamoDB
Developer Guide (API Version 2012-08-10)

Step 2: Load Data into Tables

In this step, you will load sample data into the tables that you created. You could enter the data manually into the DynamoDB console; however, to save time, you will use the AWS Command Line Interface instead.

Note

If you have not yet set up the AWS CLI, see Install and Configure the AWS CLI for instructions.

You will download a .zip archive that contains JSON files with sample data for each table. For each file, you will use the AWS CLI to load the data into DynamoDB. Each successful data load will produce the following output:

{    
    "UnprocessedItems": {}
}

Download the Sample Data File Archive

  1. Download the sample data archive (sampledata.zip) using this link:

  2. Extract the .json data files from the archive.

  3. Copy the .json data files to your current directory.

Load the Sample Data Into DynamoDB Tables

  1. To load the ProductCatalog table with data, enter the following command:

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

  2. To load the Forum table with data, enter the following command:

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

  3. To load the Thread table with data, enter the following command:

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

  4. To load the Reply table with data, enter the following command:

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

Verify Data Load

You can use the AWS Management Console to verify the data that you loaded into the tables.

To verify the data using the AWS Management Console

  1. Open the DynamoDB console at https://console.aws.amazon.com/dynamodb/.

  2. In the navigation pane, choose Tables.

  3. In the list of tables, choose ProductCatalog.

  4. Choose the Items tab to view the data that you loaded into the table.

  5. To view an item in the table, choose its Id. (If you want, you can also edit the item.)

  6. To return to the list of tables, choose Cancel.

Repeat this procedure for each of the other tables you created:

  • Forum

  • Thread

  • Reply