CARE (Cost Allocation and Resource Explanation) Architecture
CARE is a containerized Google Cloud FinOps and Granular Billing Intelligence platform deployed on Cloud Run (Gen2), fronted by a Global External Application Load Balancer with Google Cloud Armor WAF (OWASP Top 10 preconfigured rules) and Cloud Identity-Aware Proxy (IAP). It queries your organization's BigQuery Detailed Usage Cost Export (`gcp_billing_export_resource_v1_*`) through 7 analytical FinOps views (`FOCUS v1.0`, `GKE Split Cost Allocation`, `Tagging Governance`, `Modernization KPI`, `Daily Summary`, `Resource Granular`, and `Reconciliation Assurance`) plus an append-only Immutable Daily Financial Ledger, and synthesizes executive reports, interactive SVG graphical charts, and RFC 4180 CSV exports using Gemini Enterprise (`gemini-3.8-flash` in High Thinking mode).
./deploy.sh --guide from your terminal to serve this guide on
http://127.0.0.1:8765. Every command block below dynamically updates with your parameters and can be executed
directly from this page after explicit command review.
Parameter Dictionary & How to Look Up Every Value
Use the lookup commands below (or click Auto-Detect My GCP Environment in Section C) to find your organization and billing export parameters.
| Parameter | Description | CLI Lookup Command |
|---|---|---|
ORG_ID |
Numeric Google Cloud Organization ID | gcloud organizations list --format="table(displayName,name.basename())" |
BILLING_ACCOUNT_ID |
Cloud Billing Account ID (`XXXXXX-XXXXXX-XXXXXX`) | gcloud billing accounts list --format="table(name.basename(),displayName,open)" |
BILLING_PROJECT_ID |
GCP Project ID where your Detailed Usage Cost BigQuery dataset lives | bq ls --project_id=<PROJECT_ID> |
BILLING_DATASET_ID |
BigQuery dataset name containing the Detailed Billing Export table | bq show --format=prettyjson <BILLING_PROJECT_ID>:<DATASET_ID> |
DETAILED_BILLING_TABLE |
Table ID starting with gcp_billing_export_resource_v1_ |
bq ls <BILLING_PROJECT_ID>:<DATASET_ID> |
BQ_LOCATION |
Dataset location of your Billing Export (typically US multi-region or us-central1) |
bq show --format=json <BILLING_PROJECT_ID>:<DATASET_ID> | jq -r .location |
PROJECT_ID |
Host GCP Project ID where CARE Cloud Run & analytical views are deployed (can match BILLING_PROJECT_ID or be a dedicated FinOps project) |
gcloud config get-value project |
KMS_PROJECT_ID |
Dedicated Cloud KMS Vault Project ID (must be separate from PROJECT_ID for Separation of Duties) |
Created automatically in Step 1 if not yet present |
Configure Your Environment Parameters
Update the fields below. Every gcloud, bq, terraform, and ./deploy.sh command block
across Steps 0–9 updates in real time and persists locally in your browser.
Minimum Deployer Permissions Required to Run Setup
Ensure the operator running this deployment has the following roles on the Organization / Projects, or run the self-grant block below if you are an Organization Administrator:
Verify Google Cloud SDK, BigQuery CLI, Terraform & Active Identity
Confirm that gcloud, bq, terraform, and python3 are installed and authenticated.
Ensure CARE Host Project & Separated KMS Vault Project Exist
CARE enforces Separation of Duties (NIST SC-12 / FedRAMP High): encryption keys live in
{{kms_project_id}} while Cloud Run and analytical views live in {{project_id}}.
If {{project_id}} already exists (for example, when co-locating CARE inside your existing Billing Export project
{{billing_project_id}}), this command safely skips creating it and only creates or links what is missing.
Verify Detailed Billing Export Dataset & Generate terraform/care.auto.tfvars
This step verifies that {{billing_project_id}}:{{billing_dataset_id}}.{{detailed_billing_table}} exists,
confirms its dataset location ({{bq_location}}), and writes terraform/care.auto.tfvars.
Enable Core APIs & Provision Google-Managed Service Identities
Before Terraform binds cross-project HSM Customer-Managed Encryption Keys (CMEK) in {{kms_project_id}},
the Google-managed service agents for BigQuery, Artifact Registry, Cloud Run, Pub/Sub, Logging, Gemini Enterprise, and Access Approval
must exist in {{project_id}}.
Verify Cloud IAP Brand & Access Context Manager Policy
CARE protects its external HTTPS endpoint behind Cloud Identity-Aware Proxy (IAP) and
Google Cloud Armor WAF, granting access strictly to {{iap_authorized_member}}.
Provision Artifact Registry & Build Immutable Container Digest
Note: ./deploy.sh in Step 6 automatically runs this step for you unless --skip-build is passed.
You can also run it independently here to build and push the CARE container image to your CMEK-encrypted Artifact Registry
repository in {{region}} and pin its @sha256 digest.
Execute ./deploy.sh to Provision the Complete CARE Stack
Runs the full end-to-end deployment: validates US Data Residency and KMS Separation of Duties, verifies the location of
{{billing_project_id}}:{{billing_dataset_id}}, builds and pins the container image digest, and provisions all
7 CARE BigQuery FinOps views, the append-only care_immutable_daily_ledger table, Cloud Run v2 service,
Cloud Armor WAF, and Global External HTTPS Load Balancer.
Retrieve Load Balancer Anycast IP & Check Managed SSL Status
Point an DNS A record for {{care_domain_name}} to the Global External Load Balancer IP address below.
Once DNS propagates, Google Cloud automatically activates the managed TLS 1.3 certificate.
CARE FinOps Portal URLs & Provisioned BigQuery Views
Click Fetch Live Outputs from Terraform after running Step 6 to populate the live endpoints and resources below.
| Output Resource | Value / Endpoint |
|---|---|
| External HTTPS Portal URL (Cloud IAP + Cloud Armor) | https://care-finops.internal.agency.gov |
| Global Load Balancer Anycast IPv4 VIP | Run Step 6 / Click Fetch Live Outputs |
| Cloud Run v2 Internal Service URI | Run Step 6 / Click Fetch Live Outputs |
| CARE Analytical Views Dataset | care-finops-prod.care_finops_views |
| Immutable Daily Financial Ledger Table | care-finops-prod.care_finops_views.care_immutable_daily_ledger |
End-to-End Verification Suite (BigQuery Views, Ledger, Cloud Run & Gemini)
Run the verification tests below to validate your CARE deployment end-to-end against your real Detailed Billing Export data.
Test 8.1 — Verify All 7 CARE Analytical Views & Immutable Daily Ledger Table in BigQuery
Test 8.2 — Query FOCUS v1.0 View (`v_care_focus_v1`) Against Customer Detailed Billing Export
Test 8.3 — Trigger Initial Backfill of Immutable Daily Financial Ledger (`care_immutable_daily_ledger`)
Test 8.4 — Verify Cloud Run Service Health (`/api/v1/health`) via Authenticated Proxy
Tear Down CARE Infrastructure (Never Modifies Your Billing Export Data)
./teardown.sh only removes CARE resources (Cloud Run,
Load Balancer, and the {{care_dataset_id}} views dataset). Your raw Detailed Billing Export dataset
({{billing_project_id}}:{{billing_dataset_id}}) is strictly read-only and is never modified or deleted.