FinOps Observer
← All labs

Google Cloud cost controls / Intermediate / 30–45 min

The GCP budget that overlooks the training bucket

Investigate a project-scoped Cloud Billing budget whose label filter excludes a real lab bucket.

LAB IDfinops-04-gcp-budget-labelTRACK / finops.observer
Analyst viewing cloud cost charts beside a server rack

The scenario

A budget is restricted to the correct isolated project, but its label filter misses a training resource. Inspect the bucket and the live budget, then correct the filter without widening the project scope.

Mission objectives

  • Inspect the real bucket label and budget filter.
  • Correct the budget label while preserving the project scope.
  • Verify the live budget and clean up the lab resources.

Lab README

The GCP budget that overlooks the training bucket

The Cloud Billing budget and Cloud Storage bucket in this exercise are real. Use a dedicated, billing-enabled non-production project. The bucket is initially empty, but storage and operations can incur charges. A budget is not a spending cap; costs and label attribution may arrive late. This exercise does not generate spending or verify cost ingestion.

Install Bash, Python 3 and the Google Cloud CLI. Sign in with gcloud auth login and use an identity permitted to manage buckets in the project and budgets on its billing account. The Cloud Billing Budget and Cloud Storage APIs must already be enabled. Check the project's billing link and pricing before starting.

export GOOGLE_CLOUD_PROJECT="your-dedicated-project-id"
export GOOGLE_CLOUD_BILLING_ACCOUNT="your-billing-account-id"
./setup.sh "$GOOGLE_CLOUD_PROJECT" "$GOOGLE_CLOUD_BILLING_ACCOUNT" --accept-costs
./lab.sh inspect

Compare the bucket label with the budget filter using the Google Cloud CLI. Fix the live budget while preserving its single-project scope, amount, notification settings and other filters. Do not change any other budgets. If the installed gcloud billing budgets update crashes, use the Cloud Billing console or Billing Budget API instead.

./verify.sh
./teardown.sh

Setup records uniquely named resources in a private .lab-state directory. Keep this directory if any operation fails: it is needed for recovery and teardown. Teardown only removes the recorded budget and an empty bucket whose ownership marker matches. It never deletes a project or a billing account. Afterward confirm the budget and bucket are gone; remove local state only then. Soft delete is disabled on this disposable bucket so deletion is permanent. Do not use the bucket for anything outside this lab.

View Markdown source ↗

Get the lab

Download and inspect the installer before running it. It checks the archive's SHA-256 digest and refuses to overwrite an existing lab directory.

curl -fsSLO https://devops.download/labs/finops-04-gcp-budget-label.sh
less finops-04-gcp-budget-label.sh
bash finops-04-gcp-budget-label.sh
cd labs/finops-04-gcp-budget-label
./setup.sh "$GOOGLE_CLOUD_PROJECT" "$GOOGLE_CLOUD_BILLING_ACCOUNT" --accept-costs

When you've made your changes, run ./verify.sh. Remove lab resources with ./teardown.sh.

Download the archive instead ↗

Need a nudge?

Hint #1

Compare the bucket's labels with the budget's filter.

Hint #2

Keep the budget scoped to the lab project and change only the label filter.

Hint #3 · Learning paths on opsbreakfix.com

Explore learning paths ↗

Solved it?

Continue learning with the paths on opsbreakfix.com.

Continue to opsbreakfix.com ↗

One ecosystem.
Many perspectives.

Follow the connection from a hands-on lab to the knowledge and tools behind it.