AWS-Event-Announcement-project

 Description about the project:

This project is about building a serverless Event Announcement application using AWS. the application allow users to create events , list them on a website and send notification to subscribers.

I built this project to learn and showcase how AWS services can work together in real-world scenarios. it demonstrates skills in cloud computing such as :

  • Hosting a static website on Amazon S3
  • Storing data in DynamoDb
  • Building serverless APIs with API Gateway + Lambda
  • Sending notification via SNS
##The main goal of this project was to gain hands on experience with AWS cloud services .

# Services used in this project 

  • S3
  • Dynamo Db
  • SNS
  • Lambda
  • API Gateway
# Architecture Diagram👉


For codes and files reference github 👉(https://github.com/bilsgotchills/aws-event-announcement.git)

Step 1 : Create a S3 Bucket 
  • Enable Static website hosting in S3
  • Upload your index.html file
Step 2: Create a DynamoDB 
  • Table name : events
  • Partition Key :eventId (string)
  • Attributes : eventName, eventDate, and eventDescription.
Step 3:Created a IAM role name "dynamo-s3-sns"
  • SNS full Access
  • S3 full Access
  • BasicLambdaExecutionRole
  • AmazonDynamoDbBfull access 
Step 4: Create a SNS topic
  • Subscribe with Email/SMS
Step 5: Create 2 lambda function 
  1. Create-Event-lambda
  2.  List-event-lambda
Step 6: Set the Enviroment Variables in lambda and attach the role .

Step 7: I used API Gateway (HTTP) to expose two endpoints for the Event Announcement App:
  • POST /create -- Integrate it with create-Event-lambda (invokes create event lambda)
  • GET /list -- Integrate it with list-event-lambda (invokes list event lambda)
👉 I chose HTTP API because its simple , low-latency and easy to integrate with Lambda for this serverless app

👉 Configure CORS : We need to set our Frontend hosted on S3 and our backend hosted on API Gateway on the same origin ( domain+ port+ protocol)  otherwise our browser will block requests from our S3 page to API Gateway.
Note: For better security put your S3 bucket URL in "Allow-Origin" .

Testing of website:

(a) Copy the Bucket Website Endpoint form S3 and paste it on browser.
(b) Create a Event 
(c) If event created is successfull a newly created event will be shown in Upcoming events .


(d) DynamoDB will store the data related to events .


(e) SNS will send notifictaion to subscribers via mail.


(f) Pics related to event will be stored in S3.  

Problems faced :

(a) Newly created events appeared below older ones 
     Solution: Added createdAt timestamp in createEvent-lambda

(b) uuid package not included in Lambda deployment
     Solution: Instead of uuid we can use Node's built in crypto library to generate IDs

Learnings :
  • Learned to read CloudWatch logs to debug lambda features.
  • Understood how CORS actually work .
  • Learned that environment variables name in AWS are case sensitive.
  • Experienced the difference between HTTP API and REST API.

  

Comments

Popular posts from this blog

Multi-Tier-Website Using AWS EC2

Text-to-Speech Narrator on AWS