Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

dataslayermedia/Google-Cloud-Platform-Killswitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

10 Commits

Repository files navigation

Google-Cloud-Platform-Killswitch

Add a limit on billing costs for your GCP account.

Video Tutorial

Details from Google

https://cloud.google.com/billing/docs/how-to/notify

Enable Budget Notifications

Navigate to Billing Navigate to Budgets & alerts CREATE BUDGET

Listen to Notifications via Cloud Function

Create a cloud function with trigger type Pub/Sub Use the "index.js" and "package.json" scripts. Swap out your project ID in the index.js file. This script disable billing on the project which will render the services no longer working and stop any incremental costs from accruing.

Enable Cloud Billing API

Service Account Upgrade

Provide Billing Administration access to the Cloud Function Service Account

Publish Sub/Pub Message

https://console.cloud.google.com/cloudpubsub/topic/detail/budget-notifications?project=macgyver-services-production

{
"budgetDisplayName": "name-of-budget",
"alertThresholdExceeded": 1.0,
"costAmount": 100.01,
"costIntervalStart": "2019-01-01T00:00:00Z",
"budgetAmount": 100.00,
"budgetAmountType": "SPECIFIED_AMOUNT",
"currencyCode": "USD"
}

Validate that Billing is Disabled

https://console.cloud.google.com/billing/linkedaccount?project=macgyver-services-production

About

Limit the total costs which can be incurred by your Google Cloud Platform account.

Topics

Resources

Readme

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors