Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

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.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 1h 30m
Published
Clock icon Nov 22, 2019

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. 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"
        }
    }
    
  2. Challenge

    Add Records to the PetInventory Table

    Add the records to the PetInventory DynamoDB table using the PutItem 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 the Client or Table interfaces.
  3. Challenge

    Update All Records in the Table

    Update the records in the table with the UpdateItem API call to add the missing pet_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.
  4. 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.
  5. Challenge

    Final Confirmation with Provided Scripts

    1. Run the confirmlab.py and confirmlabfinal.py scripts:
    python3 confirmlab.py
    
    python3 confirmlabfinal.py
    
    1. Ensure the output matches the output provided in the lab information.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

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.

Start learning by doing today

View Plans