Skip to content

A cloud project to send AWS CloudWatch alarm messages through discord.

Notifications You must be signed in to change notification settings

fmsrodrigues/Discord-Cloud-Alarm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Cloud Alarm is a project to help developers monitors their applications through discord chat platform without the need to be constantly watching AWS metrics. 🧩


Technologies Logos

Discord Cloud Alarm uses bleeding edge technologies, as Lambda Layers, Terraform and SWC, focusing on speed, light weighting and reproducibility. ⚡


Index

Getting Started

To start using Discord Cloud Alarm project, you will need to install some tools and create accounts.

  1. Install Node.js.
  2. Create an AWS account.
  3. Install AWS CLI.
  4. Install Terraform.
  5. Install a code editor of your choice, as VSCode.
  6. Install and create a Discord account.
  7. Configure your aws cli and terraform cli.

Now you're ready to run Discord Cloud Alarm. 🚀

Running the app

Core

  1. Go to <root>/layers/dotenv/nodejs directory.
  2. Run npm install to install all dependencies.
  3. Repeat the process above to <root>/layers/got/nodejs and <root>/layers/regenerator-runtime/nodejs directories.
  4. Go to <root>/lambdas/cloudwatch-discord-alarm directory.
  5. Copy the .env.example file on the root of this folder with the name .env
  6. Fill all variables lines with your respective configuration.
    1. Don't forget, those values change based on your discord webhook.
  7. Run npm run install to install all dependencies.
  8. Run npm run build to build your application.
  9. Go to <root>/.infra directory.
  10. Run terraform validate to verify if the terraform syntax is correct.
  11. Run terraform plan to view all the changes that will be made to your AWS infrastructure.
  12. Run terraform apply to deploy to production.

Testing

Those steps are independents, you can do whatever you like.

  • Run npm test on <root>/lambdas/cloudwatch-discord-alarm directory to verify if the typescript code is working properly.
  • Run aws cloudwatch set-alarm-state --alarm-name "cloudwatch-discord-alarm-lambda-alarm" --state-reason "Testing the Amazon Cloudwatch alarm" --state-value ALARM to force the AWS CloudWatch state to change to ALARM and trigger the SNS event to call the lambda function and send you a discord message! Use this to verify if everything is working properly!

Development

You may want to change something on the project code and to do some you'll have to make some tweaks to the index.ts file using the index.spec.ts file as a reference, then run npm run dev.

Contact

If you want, for any reason, to contact me, you can reach me at [email protected]. 📧

Notes

  • Discord Cloud Alarm is a project based on multiple researches, documentations and trial and error.
  • Due to an issue with swc (2022/07/06) I had to use a workaround propoused by another developer to avoid compiling the .spec file and deploy it to production.
  • This project focus on problem-solving, practicing and exhibiting all the knowledge I gathered through work, courses, guides and others projects across the years.
  • Last feature update commit: 2022/07/12

About

A cloud project to send AWS CloudWatch alarm messages through discord.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published