This repo contains the code for the provisioning of the resources necessary to get billing alerts from the Google Cloud Platform into Slack. This example is based on the official Google documentation.
The components are organized by folders which contain the following:
- Full Output - Provides the full json payload as a slack message (This helps you choose which fields you may want in a smarter, cleaner message).
- Smart Output - Provides a smart, human readable message/alert into the Slack channel.
- Budget Output - Provides a smart, human readable message/alert into the Slack channel only when the budget hits 90% consumption.
The first step is to follow the steps listed Here to enable/create:
- New Pub/Sub Topic
- Create a budget and enable notifications
- Create Cloud Function and use the example code from this repo
- When creating the Google Cloud Function, use node.js 8 as the version of node.
- Paste in the index.js and package.json
- Set the function to execute as "subscribe"
Any issues, please raise an issue against this repo and it will be investigated. Any enhancements, feel free to fork the repo and issue a new pull request.