In this lab, we will implement a simple application that accepts CSV files, converts them to DynamoDB JSON, and puts the data into a table with the same name as the file. In the solution video, we will walk through how to reach these goals with the Python Boto3 SDK.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Write Application Code
Write code utilizing the AWS SDK for the language of your choice to convert the CSV file with the field delimiter of
Ԙ
and quotation character ofԡ
to the DynamoDB JSON format as seen below. Also include table creation for tables that share the name of the provided files without the file extension, and write the converted files to the appropriate tables.Data Conversion Sample
So this:
"ԡ12ԡԘԡGiant Sandԡ"
Becomes:
{ 'id': { 'N': '12' }, 'name': { 'S': 'Giant Sand' } },
Hint: The code can be found on GitHub.
- Log In to the Provided EC2 Instance and Run the Code
- Log in to the provided EC2 instance using the provided IP address and credentials.
- Write your code to a file named
pinehead_data_util
and configure to be able to run as a command. - Run your code!
- Verify the Data Migration to AWS
- Log in to the AWS Management Console for the lab account with the provided credentials.
- Navigate to DynamoDB.
- Verify there are three tables and the appropriate data loaded correctly.