Skip to content

Muyun2023/AWS_CDK_LeetcodeMonitor

Repository files navigation

A CDK project that notifies users about their LeetCode progress via email. Utilized Github Action to create an automated deployment pipeline

LeetCode Progress Tracker
Technologies Used: AWS S3, AWS SES, AWS Eventbridge, AWS Step Function, AWS Lambda, AWS CDK, Python, TypeScript, Requests Library, JSON

This is a sample email you will receive:

This is the design diagram: 6

This shows the design works correctly: 7


Must-Dos before running the project (search for TODO in the code):

  1. Create a Lambda Layer from the ZIP file in S3, which includes the requests library . This is done manually by uploading the ZIP file to a S3 bucket: requests_layer.zip 3

  2. Find the deploy.yml at .github/workflows, you will see ${{ secrets.AWS_ACCESS_KEY_ID_GAMMA }}, ${{ secrets.AWS_SECRET_ACCESS_KEY_GAMMA }}. these secrets need to be added to the GitHub repository. Go to repository settings -> secrets and variables (left panel) -> action -> new repository secret 1 2

  3. Replace with your SES-verified email and destination email. Go to AWS console, go to SES service, on the left panel, click on identities under Configuration, and create a new identity 4

  4. Complete the TODO list note in codes. Pay attention to the account id, access key, secret access key, and region, replace them to your own information. Currently deployed to one region: us-east-2. You can uncomment the deploy.yml to deploy to more prod stages/regions


How to get started:

  • aws configure set up aws account connection -> in ChatGPT, search "how to set up aws configure" . if you don't have the AWS Access Key ID and Secret Access Key, search "AWS Access Key ID and Secret Access Key"
$ aws configure
AWS Access Key ID [None]: yourID
AWS Secret Access Key [None]: yourKey
Default region name [None]: us-east-2
Default output format [None]: json
  • npm run build compile typescript to js
  • cdk bootstrap If this is your first time using AWS resources, you need to run cdk bootstrap once before running cdk deploy,
  • cdk deploy This is an optional step as you can run below git commands. deploy this stack to your default AWS account/region
  • git add .
  • git commit -m "new code"
  • git push

Useful commands

  • aws configure set up aws account connection
  • npm run build compile typescript to js
  • npm run watch watch for changes and compile
  • npm run test perform the jest unit tests
  • cdk bootstrap before running cdk deploy, you need to run cdk bootstrap once when deploying to a new region
  • npx cdk deploy deploy this stack to your default AWS account/region
  • npx cdk diff compare deployed stack with current state
  • npx cdk synth emits the synthesized CloudFormation template

special mention: thanks to this useful API provided in https://github.com/alfaarghya/alfa-leetcode-api

© Muyun Ji. Confidential and Proprietary. All Rights Reserved.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors