Skip to content

lambda to post current AWS cost to a slack channel of your choice

Notifications You must be signed in to change notification settings

schwellnus/aws-costexploder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-costexploder

The AWS key will need the following permissions:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ce:*"
      ],
      "Resource": [
        "*"
      ]
    }
  ]
}

The Slack Webhook needs permission to write messages.

The lambda needs the following ENV variables:

AWS_ACCESSKEY='<add aws accesskey here>'
AWS_SECRET_ACCESSKEY='<add aws secret access key here>'
SLACK_WEBHOOK_URL='<add slack webhook url here>'

and can take an optional

COSTEXPLODER_MSGPREFIX="<add the text to be displayed before the cost value here >"

To deploy manually, zip up index.js and node_modules/ and upload to lambda in the AWS console.

To trigger automatically, use CloudWatch Events:

Setup a cron like so: cron(59 7,16 * * ? *) to run the lambda at 7:59am UTC and 6:59pm UTC every day.

About

lambda to post current AWS cost to a slack channel of your choice

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published