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. 🧩
Discord Cloud Alarm uses bleeding edge technologies, as Lambda Layers, Terraform and SWC, focusing on speed, light weighting and reproducibility. ⚡
To start using Discord Cloud Alarm project, you will need to install some tools and create accounts.
- Install Node.js.
- Create an AWS account.
- Install AWS CLI.
- Install Terraform.
- Install a code editor of your choice, as VSCode.
- Install and create a Discord account.
- Configure your aws cli and terraform cli.
Now you're ready to run Discord Cloud Alarm. 🚀
- Go to
<root>/layers/dotenv/nodejs
directory. - Run
npm install
to install all dependencies. - Repeat the process above to
<root>/layers/got/nodejs
and<root>/layers/regenerator-runtime/nodejs
directories. - Go to
<root>/lambdas/cloudwatch-discord-alarm
directory. - Copy the
.env.example
file on the root of this folder with the name.env
- Fill all variables lines with your respective configuration.
- Don't forget, those values change based on your discord webhook.
- Run
npm run install
to install all dependencies. - Run
npm run build
to build your application. - Go to
<root>/.infra
directory. - Run
terraform validate
to verify if the terraform syntax is correct. - Run
terraform plan
to view all the changes that will be made to your AWS infrastructure. - Run
terraform apply
to deploy to production.
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 toALARM
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!
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
.
If you want, for any reason, to contact me, you can reach me at [email protected]. 📧
- 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