AgentsGCPGCP Budget Alert Configuration

GCP Budget Alert Configuration

Generate GCP budget alert configurations with custom thresholds, notification channels, and cost-sink routing.

Tested against gcloud 4xx · windsurf-1.6+ · cursor-0.45+

DIRECTIVE / gcp-budget-alert-setup
You are a GCP FinOps engineer. Your task is to generate a budget alert configuration with thresholds, notification channels, and routing for a project or billing account.

Context:
- You have READER access to the billing account and Notification API.
- You will generate the configuration as commands or YAML, not apply it.

Steps:
1. Identify the scope: an entire billing account or a specific project with optional filter (e.g. only production labels).
2. Set the budget amount: a monthly amount or an amounts-based rule; note whether it is tied to spend de-risking or to projected spend.
3. Define threshold rules: pick percentages like 50%, 90%, 100%, and for the 100% decide forecast vs actual.
4. Create notification channels: list channels with gcloud alpha billing budgets list or gcloud monitoring channels list, and pick an email/PubSub/Webhook channel.
5. Emit the configuration: gcloud billing budgets create with --budget-amount, --threshold-rule, and --filter-projects / --filter-labels, or a YAML you feed through the Budgets API.

Output format:
- The exact command(s) or YAML to create the budget.
- A short note on which thresholds are normal and how alerts route.

Constraints:
- Use only valid syntax from the actual billing budgets command family.
- Never apply the budget; output for approval.
- Only tie budget to a filtered scope if told to; otherwise keep it account-wide.

Example:
Input: budget production spend at 5000 USD with 50/90/100% thresholds to email finance@.
Output: gcloud beta billing budgets create --billing-account=000000-AAAAAA-BBBBBB --display-name=prod-budget --budget-amount=5000 --threshold-rule=0.5 --threshold-rule=0.9 --threshold-rule=1.0 --notification-channel=<ch1>, email finance@ via channel.

Why this directive matters

A GCP cloud bill without a budget is a guess, and the forecast rarely arrives before the invoice. Budget alerts are the earliest cue that spend is running hot, but the configuration details, thresholds, notification channels, and whether to use forecast or actual, decide whether the alert is useful or just noise at 99% when it is already too late. This directive has the agent lay out the budget decision for a billing account or a tagged slice of a project, pick sensible thresholds such as 50/90/100 with a forecast rule at the top, and wire a real notification channel. The output is the exact create command or YAML so a FinOps lead can review and apply it. Keeping it read-only and scoped means the plan is safe to produce for any project, and the delivered file turns a previously manual setup into a repeatable step.

Test Command

gcloud billing budgets list --billing-account=<ACCOUNT>

Prerequisites

  • Billing Account READER
  • gcloud authenticated
  • Budget API enabled

Expected Outputs

  • Budget create command/YAML
  • Threshold routing summary

References

THE NEXT STEP

Automate it past the prompt.

This beginner directive is a manual, read-only run. Devopsify can run the same check continuously across your estate, with policy gates, approvals, and a retained audit trail.