This tool will collect and create Daily & Monthly AWS cost reports and put them into Slack
The format should be like this
<date> - Amazon Elastic Compute Cloud (Instance1): $<value>
<date> - Amazon Elastic Compute Cloud (Instance2): $<value>
<date> - Amazon Elastic Compute Cloud (InstanceN): $<value>
<date> - Amazon EC2 Container Registry (ECR): <value>
<date> - Amazon Simple Storage Service: $<value>
<date> - AWS Key Management Service: $<value>
<date> - AWS Data Pipeline: $<value>
Total Spent: <value>
This tool uses a specific file that is generated by AWS. To activate the generation, you should activate the Detailed billing report with resources and tags
In order to fully take advantage of the potential, you should Tag your resources accordingly, otherwise you will see a lot of this
<date> - Amazon Elastic Compute Cloud (): $<value>
This function could be set to be used as standalone, but the way we use it is by setting a AWS Cloudwatch, and a AWS Lambda function
Since this project uses node_modules
, we have 2 ways of passing the code to AWS Lambda
- Uploading to AWS S3
- Creating a ZIP file and uploading to Lambda (We usually use this, but could be changed)
- Create a ZIP file
- Upload to AWS Lambda
- Set the AWS Cloudwatch to call the function on the desired period of time
- You are all set
SLACK_URL
: This is the Slack URL that will be used to make the post to. Format https://hooks.slack.com/services/<hash>/<hash>/<hash>
AWS_ACCOUNT_ID
: AWS account ID. This envar will be used to download the report file