Challenge of the day:
I would like a way to be made aware of the NBA GAMES happening. It is sometimes hard to check through a website to find out the game stats.
Solution:
I have been able to build a game notification system that sends you a notification from your email or phone number using an AWS service known as AWS Simple Notification Service
WORKFLOW:
The set time for the eventbridge rule sends a trigger to the lambda function.
The lambda function sends a request to the sportsdata api
The data is sent back to the function
The data is sent to the subscribed users via SNS
Features
Fetches live NBA game scores using an external API.
Sends formatted score updates to subscribers via SMS/Email using Amazon SNS.
Scheduled automation for regular updates using Amazon EventBridge.
Designed with security in mind, following the principle of least privilege for IAM roles.
AWS SERVICES INVOLVED:
EventBridge
Amazon Eventbridge allows for users to build event driven applications eg through rules, event buses and global endpoints. In this case,we define a rule that runs on a schedule. This allows us to define a schedule. This system runs better with a recurring schedule that is set through a cron expression.
A cron expression helps define the frequency of the function running
AWS Lambda
AWS Lambda is a serverless compute service running on AWS that allows for one to run code without provisioning or managing infrastructure while paying only for the compute you use.
This system uses lambda to create the function, mostly working with the code(in python)
Using lambda, you are able to deploy the code, set the environment variables, test your code and monitor the functionality.
Identity and Access Management Center
AWS IAM, as in the name, is a service used to manage , set permissions and verify users using the root account.
The following are sections in IAM:
1. Users- these are user accounts created under the root account where the user can be restricted to specific services.
Roles- these are identities created with specific permissions ie. they can perform certain activities using some services while others they cannot.
Policies- policies are like rules, they define the permissions the user/roles attached to them have. Policies are mostly used for roles and user groups for easy management.
User groups-a collection of IAM users that are under specific permissions
We use IAM in our system to create policies and roles for using lambda.It is recommended to create roles and policies when it comes to accessing the services for different needs. It is also easier to keep track of spending and usage using the policies.
Simple Notification Service
Amazon SNS is a service used to send notifications to users based on subscription. Users can subscribe to a topic of choice based on their need.
Skills learned:
Designing a notification system with AWS SNS and Lambda.
Securing AWS services with least privilege IAM policies.
Automating workflows using EventBridge.
Integrating external APIs into cloud-based workflows.
Understanding code set for deployment and alteration to suit needs
I challenged myself to add another feature where the user can receive data on stadiums available as well. Glad to report it worked perfectly!
Here is the Github repo if you’d like to check it out:
https://github.com/mbengiivy/NBA-Notification-System