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.
Steps to Build the Architecture
Step-1:Create Table in Amazon DynamoDB.
Step-2: Create a Lambda Function (NodeJS)
Step-3:Create a New Role
Step-4:After creation of this role attach some more policies
Step-5:Go to Lambda Function
Lambda Code -> CastVoteFun.Write the code ,deploy it and test the event
Recommended by LinkedIn
Create a Another Lambda Function integrate with Dynamo DB(ADD Trigger)
Add the code CastVoteJSON
Step-6:API Gateway.Configure API gateway
Step-7:Create the above Resource->create a method POST
Step-8:Create post method Add Lambda Function to it and add mapping template code.
Step-9:In Method response remove 200 and ADD 204
Step-10: In Integration response Add 204 in default and remove 200
Step-11:Click on Test
Step-12: Copy Invoke URL and add it in index.html
Create an S3 bucket with the static web hosting
Upload the files in S3.
Step-13:Add s3 files in bucket with default settings add bucket policy and enable static Website Hosting .Add Bucket Policy
Step-14: Go to S3 Bucket Properties -> static hosting ->Copy Url
Conclusion:
The Voting Application Architecture that Displays the Results on AWS Cloud using DynamoDB, Lambda Function, API Gateway, S3 Bucket.
Thank you!!!