Summarise AWS/Billing EstimatedCharges for Slack
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
functions/slack Initial Sep 12, 2018
LICENSE Initial commit Sep 12, 2018
Makefile Initial Sep 12, 2018
README.md Add deployment notes Sep 18, 2018

README.md

Summarise AWS expenditure

Requires billing alerts to be enabled in your billing preferences & CloudWatchReadOnlyAccess in the role https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/monitor-charges.html

Reference case #5314191201

Updates twice a day

Triggered at the start & end of the working day in Singapore

Deployment notes

Currently the code is defined for my use case and accounts. Notice two accounts are in an organisation and another uses a cross account role to get the metrics.

There are many ways to deploy a serverless function, however I'm using http://apex.run/ in this instance. The project.json looks like:

{
  "name": "estimatedcharges",
  "description": "Post to slack a summary of the estimated charges of the AWS account",
  "profile": "my-profile",
  "memory": 128,
  "timeout": 5,
  "role": "arn:aws:iam::812644853088:role/estimatedcharges_lambda_function",
  "environment": {
	"WEBHOOK": "https://hooks.slack.com/services/XXXXX/YYYYYY/etcetc"
  }
}