- Lab
- A Cloud Guru

Using a DynamoDB Table Basic I/O
In this lab, we will explore the read and write processes available for a DynamoDB table. In the lab instructions, you will find a scenario that provides some sample data that will need to be entered into a DynamoDB table, as well as several ways to retrieve the data from the DynamoDB table. In the solution videos, we will walk through reading from and writing to a DynamoDB table with the AWS Management Console, AWS CLI, and the Python Boto3 SDK.

Path Info
Table of Contents
-
Challenge
Convert Provided CSV Data to DynamoDB JSON
Convert the following provided CSV records:
Monitor Lizard,319,Duncan,Moss,4,Male,Null,Spiky Iguana,146,Jessica,Seaweed,10,Female,Null,Rough Iguana,159,Paul,Basil,3,Male,Null,Rough Chinchilla,631,Shadam,Stone,2,Male,Soft,Null Chinchilla,805,Irulan,Snow,1,Female,Soft,Null Red-tailed Boa,3,Vladimir,Abalone/Brick,18,Male,Null,Smooth Red-tailed Boa,9,Feyd-Rautha,Ash/Caramel,8,Male,Null,Smooth
To make them, DynamoDB JSON syntax is shown below:
{ "age": { "N": "4" }, "color": { "S": "Moss" }, "gender": { "S": "Male" }, "name": { "S": "Duncan" }, "pet_id": { "N": "319" }, "pet_species": { "S": "Monitor Lizard" }, "scale_texture": { "S": "Spiky" } }
-
Challenge
Add Records to the PetInventory Table
Add the records to the
PetInventory
DynamoDB table using thePutItem
API call.This can be accomplished in one of the following ways:
- With the Create Item button in the AWS Management Console.
- With the
aws dynamodb put-item
command in the AWS CLI. - With the Boto3 SDK
put_item
method for theClient
orTable
interfaces.
-
Challenge
Update All Records in the Table
Update the records in the table with the
UpdateItem
API call to add the missingpet_available
attribute.This can be done in one of the following ways:
- Editing the item in the AWS Management Console.
- With the
aws dynamodb update-item
command in the AWS CLI. - With the Boto3 SDK
update_item
method.
-
Challenge
Confirm Data Has Been Added and Updated Successfully
Manually confirm all data has been updated in the table correctly in one of the following ways:
- Review the table output in the AWS Management Console.
- Run
aws dynamodb scan --table-name PetInventory
in the AWS CLI.
-
Challenge
Final Confirmation with Provided Scripts
- Run the
confirmlab.py
andconfirmlabfinal.py
scripts:
python3 confirmlab.py python3 confirmlabfinal.py
- Ensure the output matches the output provided in the lab information.
- Run the
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.

