How do I test GCP budget monitoring notifications?

Viewed 45

How do I confirm I've set up GCP budget monitoring notifications correctly?

I've created a test budget w/ some thresholdPercents and an email based monitoringNotificationChannel.

Ideally, I'd like to burn a single $1 dollar (or even a little more) to trigger the .01 thresholdPercent notification (1% of 100USD = $1).

But I don't what/how to run/deploy in GCP anything that will do that.

Here's my test budget:

PS C:\TEST> gcloud billing budgets create 
--filter-projects=projects/testprj 
--billing-account=0123456-789012-345678 --display-name="MYAWSUM-TESTBUDGET" 
--budget-amount=100.00USD 
--threshold-rule=percent=0.01 --threshold-rule=percent=0.50 
--start-date=2022-07-01 --end-date=2022-09-30 
--notifications-rule-monitoring-notification-channels=projects/testprj/notificationChannels/0987654321

Created [b7d51ec4-1234-4825-a95e-b2c99b89b006].


PS C:\TEST> gcloud billing budgets list --billing-account=0123456-789012-345678
amount:
  specifiedAmount:
    currencyCode: USD
    units: '100'
budgetFilter:
  creditTypesTreatment: INCLUDE_ALL_CREDITS
  customPeriod:
    endDate:
      day: 30
      month: 9
      year: 2022
    startDate:
      day: 1
      month: 7
      year: 2022
  projects:
  - projects/624270349538
displayName: MYAWSUM-TESTBUDGET
etag: '1658773026868358'
name: billingAccounts/0123456-789012-3456782/budgets/b7d51ec4-1234-4825-a95e-b2c99b89b006
notificationsRule:
  monitoringNotificationChannels:
  - projects/testprj/notificationChannels/0987654321
thresholdRules:
- spendBasis: CURRENT_SPEND
  thresholdPercent: 0.01
- spendBasis: CURRENT_SPEND
  thresholdPercent: 0.5
0 Answers
Related