[Recipes] Create a DynamoDB Table from AWS Console

Problem: 

Need to create tables in DynamoDB from AWS Console.

Solution Summary: 

We can create DynamoDB tables from DynamoDB dashboard in the AWS console.

Prerequisites: 

This lab assumes you have followed previous labs and created a user with necessary permissions, installed awscli, and created and setup profile in local. 

Creating User:

  1. Create a new user: Users > Add User > Give a name (e.g. dynamodbadmin ) , Select both access types (programmatic access, console access with custom password), Attach existing policy directly (add Administrator Access policy). Once the success message appears download credentials, as you will not be able to get it later.

  2. For tracking the cost, you can also activate IAM User Access to Billing Information, by going to My Account tab from the user drop down (top right). It may be also a good idea to set up MFA.

  3. Log off and login to the account using the newly created user (Use the IAM users sign-in link customized earlier).

Setting up local:

Though you can install AWS CLI using windows installer easily, we will do it using python and pip, as for other environments (e.g. Mac, Linux) that is the preferred way.

Solution Steps: 

  1. Login to AWS console using the sign in link and user created for dynamodob.
  2. Go to DynamoDB dashboard
  3. Click on ‘Create Table’ button.
    1. Give name as: course_data
    2. Give Primary key/Partition key as: course_id with String data type.
    3. Give Primary key/Sort key as: dateandtime with String data type.
    4. Leave the option ‘Use default settings’ selected.
    5. Click ‘Create’.
    6. Wait until the progress symbol disappears.
  4. You can go to dashboard to see any alarm triggers or service health issues, and capacity details. Tables will show you table details. Clicking on table name will show you details for the table. Following are the tabs for table: Overview, Items, Metrics, Alarms, Capacity, Indexes, Triggers, Access Control, Tags.
  5. Click on our table and go to Items tab.
  6. Click on Create Item button. You will be asked to provide values for the key fields, which you cannot skip. Give valid values: c001, 2017/4/30 00:00. Click Save
  7. Create another Item: Give valid values for keys: c002, 2017/4/30 00:00. Click on the + button alongside dateandtime, click on append to add a field. Give name as ‘duration_in_time’ and type as Number.
  8. Next we will do similar and more operations from command prompt. 

Recipe Tags: 

Learn Serverless from Serverless Programming Cookbook

Contact

Please first use the contact form or facebook page messaging to connect.

Offline Contact
We currently connect locally for discussions and sessions at Bangalore, India. Please follow us on our facebook page for details.
WhatsApp (Primary): (+91) 7411174113
Phone (Escalations): (+91) 7411174114

Business newsletter

Complete the form below, and we'll send you an e-mail every now and again with all the latest news.

About

CloudMaterials is my blog to share notes and learning materials on Cloud and Data Analytics. My current focus is on Microsoft Azure and Amazon Web Services (AWS).

I like to write and I try to document what I learn to share with others. I believe that knowledge is useless unless you share it; the more you share, the more you learn.

Recent comments

Photo Stream