# 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.

```sh
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.

```sh
./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.
