hands-on lab

Building a Python Client for Amazon DynamoDB

Difficulty: Intermediate
Duration: Up to 1 hour and 30 minutes
Students: 5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

In this lab, you will gain hands-on experience developing and testing a Python application that uses the AWS SDK for Python (Boto3) to interact with an Amazon DynamoDB database table.

Beyond just interacting with the database, you will also gain experience in the fuller development experience by using the AWS Command Line Interface (AWS CLI) to verify the result of running your application, which will insert data into the database, fetch the data, and query for it using two different query types.

Note: This is an intermediate level lab. Most of the coding tasks will provide parts of the solution, but will require the student to work through the implementation. However, a solution file is provided if the student gets stuck.

Learning objectives

Upon completion of this intermediate level lab, you will be able to:

  • Use the AWS CLI to verify the DynamoDB database table exists
  • Create Python client and resource objects for interacting with DynamoDB
  • Put data into the DynamoDB table using the Python Boto3 library
  • Query the DynamoDB table using the Python Boto3 library
  • Query the DynamoDB table using the AWS CLI as a way to verify the results

Intended audience

  • Candidates for the AWS Certified Developer Associate certification
  • Cloud Developers
  • Data Engineers

Prerequisites

To get the most out of this lab, you should be familiar with the following:

  • Python
  • DynamoDB

Familiarity with the following will be beneficial but is not required:

  • AWS SDK for Python (Boto3)
  • AWS Command Line Interface (AWS CLI)

The following content can be used to fulfill the prerequisites:

Environment before

Environment after

Covered topics

Lab steps

Setting up IDE and Gaining Project Familiarity
Creating Client and Resource
Performing Put and Get
Performing Queries