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
# Services used in this project
- S3
- Dynamo Db
- SNS
- Lambda
- API Gateway
# 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
- Table name : events
- Partition Key :eventId (string)
- Attributes : eventName, eventDate, and eventDescription.
- SNS full Access
- S3 full Access
- BasicLambdaExecutionRole
- AmazonDynamoDbBfull access
- Subscribe with Email/SMS
- Create-Event-lambda
- List-event-lambda
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)
👉 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
Post a Comment