Google Cloud Billing Budget

This page shows how to write Terraform for Cloud Billing Budget and write them securely.


Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.


Terraform Example (google_billing_budget)

Budget configuration for a billing account. To get more information about Budget, see:

  • API documentation
  • How-to Guides
    • Creating a budget

      Warning: If you are using User ADCs (Application Default Credentials) with this resource, you must specify a billing_project and set user_project_override to true in the provider configuration. Otherwise the Billing Budgets API will return a 403 error. Your account must have the permission on the billing_project you defined.


  • billing_account required - string
    • ID of the billing account to set a budget on.

  • display_name optional - string
    • User data for display name in UI. Must be <= 60 chars.

  • id optionalcomputed - string
  • name requiredcomputed - string
    • Resource name of the budget. The resource name implies the scope of a budget. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

Example Usage (from GitHub)

resource "google_billing_budget" "this" {
  billing_account =
  display_name    = "GCP Budget Alert"

  budget_filter {
    credit_types_treatment = "INCLUDE_ALL_CREDITS"
resource "google_billing_budget" "budget" {
  provider = google-beta
  depends_on = [google_project_service.gcp_services]

  billing_account =
  display_name = "Budget Keeper Budget"
resource "google_billing_budget" "budget" {
  provider = google-beta
  billing_account =
  display_name = var.budget_name

  budget_filter {

Frequently asked questions

What is Google Cloud Billing Budget?

Google Cloud Billing Budget is a resource for Cloud Billing of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google Cloud Billing Budget?

For Terraform, the mintak21/terraform, glipecki/gcp-budget-keeper and ekalachev/BigData source code examples are useful. See the Terraform Example section for further details.