AWS pricing system is very complicated, so there are many useful tools that can notify AWS cost daily or monthly.
Many tools are developed for Slack, but I love Discord.
Therefore, I developed AWS Cost Notification System for Discord.
This system can notify "Today's AWS cost" to Discord at 23 o'clock every day.
Also, that can notify "Last Month's AWS cost" to Discord at 23 o'clock first day of the month. (This can be changed at index.js)
All source code: https://github.com/K-Rintaro/aws-cost-discord-notify
Requirement
node.js
npm packages
・aws-cost-explorer
・dotenv
・discord.js
・node-cron
・node-fetch
How to use
aws-cost-discord-notify needs to use AWS Cost Explorer API.
That costs 0.01 USD every request.
- Create your Discord bot at https://discord.com/developers/applications
- Create AWS IAM user and get access key id & secret access key
Example policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ce:*"
],
"Resource": [
"*"
]
}
]
}
- Create .env file and set Discord token, AWS access key and AWS secret access key that you got.
- Get index.js from GitHub repo and set your Discord channel id. You can change notification time, too.
I hope I can be of any help to you.
Top comments (0)