paint-brush
How To Integrate Your Laptop With AWS And Deploy DynamoDB Locallyby@sachin962
241 reads

How To Integrate Your Laptop With AWS And Deploy DynamoDB Locally

by Sachin MalviyaApril 17th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Sachin Malviya is IT professional and working on AWS technology, self learner and Innovator. Here I have explained how to connect local machine to create, access your DynamoDB database. Using DynamoDB we can create, manage, and get table information from AWS in very simple way like without installing any additional things. We need to use python as programming language to perform read, write and related operation. To interact with AWS to python we required library or SDK (Software Development Kit)

Company Mentioned

Mention Thumbnail
featured image - How To Integrate Your Laptop With AWS And Deploy DynamoDB Locally
Sachin Malviya HackerNoon profile picture

How to Interact with AWS (Amazon Web Services) cloud from your local machine. More specifically using python IDE to handle easily. Here I have explained how to connect local machine to create, access your DynamoDB
table

What is DynamoDB ?

DynamoDB works and managed by NoSQL. Using DynamoDB we can
create table and retrieve the data from table any amount of data. As it doesn’t depend on server, hardware so dependency system/server hardware so, more reliable.

This post basically how to interact or set up access from
your local system to AWS account to create, manage, and get table information from AWS in very simple way like without installing any additional things. Here I have shown for windows operating system.

Pre-requisites:-

  • You must have an AWS account. It can be free tier version
  • Laptop with jupytor Notebook python IDE.
  • Initial knowledge of python.

Step 1:

  • Login to the AWS console go to the IAM (Identity Access Manager) services.
  • Create a user or if you have an existing user so no need to create again. However this user should have programming privilege to perform required operation in my case I have given full privilege access.
  • Then keep the other settings as default and click on review and save.
  • In my case user is “testuser”
  • After successful creation of user it will show us access key and secret key which is one of the most important part of this integration, it looks like below

Step 2: Copy and save at secret folder it is user identity which identifies the user uniquely.

Now we have done for credential part, now few essential thing we need to done at AWS console side.

  • Select the availability region in where we required this database to read or write.
  • It is recommend from AWS to select availability zone which is nearer to your Geo location. Below region are there at very first of AWS console at most right above corner.

Step 3:

Now to program AWS console from your laptop we need to configure few thing which are explained as below:-

  • Go the command line prompt from start by simply typing ‘cmd’ a black window would appear.
  • Then type command “aws configuration” then press enter

As far as we hit the enter it will give prompt to put access key, secret key, region name & output format.

Step 4:

Till this steps our machine has ready to interact with AWS.
Now we need to deal with programming part here we will us python as programming language to perform read , write and related operation.

  • Install jupytor Notebook which is IDE for python coding.
  • To interact with AWS to python we required library or SDK (Software Development Kit). AWS has Boto SDK for python. It enables developer to configure, modify using interactive script.
  • Install boto3 package as we install other packages in python
  • Now import the library in coding after boto3 package would allow us to work with AWS terminologies like dynamoDB services, table creation, data loading into the table and data retrieve.

Here I am creating table a table name ‘testuser’ into dynamodb
database which has few attributes like first name and last name of some
students. Both attributes are string type. Please the below code

  • Once you execute this program in jupytor notebook wait for code execution and refresh the AWS console under AWS dynamoDB services. Here you go….after few seconds table created named as testuser with defined attributes.
  • If we run few more command to see what this new table contain like how many item we will get output as zero.
  • Now we want to write some data to the table ‘testusers’. So, by caling put_item method we can do that
  • Similarly we can read the data from table with the help of primary key attribute using get_item method.

Output:

  • As above read and write operation we can perform other operation as well like delete the particular item, add more item to the table

So, We have integrated our machine with AWS and we can create and manage table from our laptop. Please me know if any query at any step i would be happy to help......Thanks for Reading...