top of page

How to integrate SpringBoot application with AWS Dynamo DB

  • Writer: Subhasish Sahu
    Subhasish Sahu
  • Apr 23, 2020
  • 1 min read

Updated: May 25, 2020


Pre - Requisite :


  1. Java 1.8 ( or above)

  2. Intellij Idea IDE

  3. WinSCP

  4. Putty and PuttyGen

  5. AWS Account


Please refer my previous blog on EC2 instance creation,putty and winscp installation and connecting it with EC2


Logon to AWS account and click on the drop down on the top right hand side



ree

ree

Create New Access Key


ree




Create Database in Dynamo DB


ree


ree


ree


ree

Click on create and the add data to Dynamo DB table :



ree

ree

ree





Open Intellij IDEA IDE and Compile it



ree


ree

Please not ,we will connect to AWS using region instead of url/endpoint and enter the accesskey and secretkey in the properties files derived as shown in the above screenshots.


Once the code is compiled.Connect to your EC2 instance and transfer the file using WinSCP


ree

Login to the EC2 instance using putty


ree

ree

Run the commmand : java -jar springboot_awsdynamodb-ec2.jar


Open any browser


1) To Fetch the data which we had inserted in DB, we will use findById method which will return only single row based on the ID


ree

Response


ree

2) To Fetch all data, we will use findByAll method


ree

Response


ree

3) To insert/save single data


Use below code


ree

Hit below url

ree

Response:


Inserted Successfully


ree


4) To insert/save multiple data


Use below code:


ree

Hit the url :


ree

ree



Comments


bottom of page