Skip to content

woakas/aws-cost-reporter

 
 

Repository files navigation

AWS Cost Report

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>

Before Start

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

Recomendations

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>

Instructions

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)

Installation

  • 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

Neccesary envars

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

About

tool to report aws costs via slack

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 83.0%
  • Shell 17.0%