GCP.BillingBudgets reference
BillingBudget
Section titled “BillingBudget”Source:
src/GCP/BillingBudgets/BillingBudget.ts
A Cloud Billing budget.
Budgets have no labels field and the display name appears in alert
emails, so Alchemy finds its budget by display name within the current
project’s scope: read reports a budget as owned only when it carries
the generated name (an explicit displayName is reported as unowned —
adopt it with --adopt), and nuke cannot discover budgets. The
physical id is a server-assigned UUID. Changing billingAccountId or
budgetId replaces the budget. Amount, filter, thresholds,
notifications, and display name update in place.
BillingBudget: Creating a Budget
Section titled “BillingBudget: Creating a Budget”Project-scoped monthly budget
const budget = yield* GCP.BillingBudgets.BillingBudget("Spend", { displayName: "cap", amount: { specifiedAmount: { currencyCode: "USD", units: "10" } }, budgetFilter: { projects: ["projects/my-project"], calendarPeriod: "MONTH", }, thresholdRules: [{ thresholdPercent: 0.5, spendBasis: "CURRENT_SPEND" }],});Last-period amount
const budget = yield* GCP.BillingBudgets.BillingBudget("Spend", { amount: { lastPeriodAmount: {} }, budgetFilter: { calendarPeriod: "MONTH" },});BillingBudget: Updating a Budget
Section titled “BillingBudget: Updating a Budget”const budget = yield* GCP.BillingBudgets.BillingBudget("Spend", { displayName: "cap", amount: { specifiedAmount: { currencyCode: "USD", units: "25" } }, budgetFilter: { projects: ["projects/my-project"], calendarPeriod: "MONTH", }, thresholdRules: [ { thresholdPercent: 0.5, spendBasis: "CURRENT_SPEND" }, { thresholdPercent: 0.9, spendBasis: "FORECASTED_SPEND" }, ],});