Voting Application Using AWS Services
Voting Application Using AWS Services

Voting Application Using AWS Services

Aim : To Build a Serverless Voting APP using AWS Cloud Services.

Services used are AWS - Lambda, Dynamo DB, API Gateway, and S3.

What is Serverless Computing and Why Serverless ?

Serverless architecture is an approach to software design that allows developers to build and run services without having to manage the underlying infrastructure. Serverless on AWS. AWS offers technologies for running code, managing data, and integrating applications, all without managing servers. Serverless technologies feature automatic scaling, built-in high availability, and a pay-for-use billing model to increase agility and optimize costs.

Lambda:

AWS Lambda is an event-driven, serverless computing platform provided by Amazon as a part of Amazon Web Services. It is a computing service that runs code in response to events and automatically manages the computing resources required by that code.

DynamoDB:

Amazon DynamoDB is a fully managed proprietary NoSQL database service that supports key–value and document data structures and is offered by Amazon.com as part of the Amazon Web Services portfolio. DynamoDB exposes a similar data model to and derives its name from Dynamo, but has a different underlying implementation.

API Gateway:

Amazon API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and Web Socket APIs at any scale. API developers can create APIs that access AWS or other web services, as well as data stored in the AWS Cloud .

Simple Storage Service(S3):

Amazon S3 or Amazon Simple Storage Service is a service offered by Amazon Web Services that provides object storage through a web service interface. Amazon S3 uses the same scalable storage infrastructure that Amazon.com uses to run its global e-commerce network.

No alt text provided for this image
Architecture For Voting Application Using AWS Services

Steps to Build the Architecture 

Step-1:Create Table in Amazon DynamoDB.

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Step-2: Create a Lambda Function (NodeJS)

No alt text provided for this image
No alt text provided for this image

Step-3:Create a New Role

No alt text provided for this image
No alt text provided for this image

Step-4:After creation of this role attach some more policies

No alt text provided for this image
No alt text provided for this image

Step-5:Go to Lambda Function

Lambda Code -> CastVoteFun.Write the code ,deploy it and test the event

No alt text provided for this image
No alt text provided for this image

Create a Another Lambda Function integrate with Dynamo DB(ADD Trigger)

Add the code CastVoteJSON

No alt text provided for this image

Step-6:API Gateway.Configure API gateway

No alt text provided for this image
No alt text provided for this image

Step-7:Create the above Resource->create a method POST

No alt text provided for this image

Step-8:Create post method Add Lambda Function to it and add mapping template code.

No alt text provided for this image
No alt text provided for this image

Step-9:In Method response remove 200 and ADD 204

No alt text provided for this image

Step-10: In Integration response Add 204 in default and remove 200

No alt text provided for this image

Step-11:Click on Test

No alt text provided for this image

Step-12: Copy Invoke URL and add it in index.html

No alt text provided for this image

Create an S3 bucket with the static web hosting

Upload the files in S3.

No alt text provided for this image

Step-13:Add s3 files in bucket with default settings add bucket policy and enable static Website Hosting .Add Bucket Policy

No alt text provided for this image

Step-14: Go to S3 Bucket Properties -> static hosting ->Copy Url

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Conclusion:

The Voting Application Architecture that Displays the Results on AWS Cloud using DynamoDB, Lambda Function, API Gateway, S3 Bucket.

Thank you!!!

To view or add a comment, sign in

More articles by Cherukuri Vyshnavi

Others also viewed

Explore content categories