Documentation
GCP setup
Enable the required APIs, create the service account, configure Workload Identity Federation, enable the FOCUS billing export, and return the details securely.
This page covers the Google Cloud side of the connection: enable the APIs, create a dedicated service account, grant the requested roles, enable the FOCUS billing export, and register Jetscale as a federated identity provider so no service account key is exchanged.
Get the OIDC issuer URL and subject claim from your Jetscale contact before you start; Steps 5 and 6 cannot be completed without them. Every bracketed value below is a placeholder for something Jetscale or your own project supplies.
Before you start
- Project IAM Admin (
roles/resourcemanager.projectIamAdmin) or Owner on the project. - Google Cloud console access, or the
gcloudCLI installed and authenticated. - Billing Account Administrator on each billing account, to enable the export in Step 4.
- Jetscale's OIDC issuer URL and subject claim.
Step 1: Enable the required APIs
export PROJECT_ID="your-project-id"
gcloud config set project "$PROJECT_ID"
gcloud services enable \
cloudresourcemanager.googleapis.com \
cloudasset.googleapis.com \
cloudbilling.googleapis.com \
compute.googleapis.com \
storage.googleapis.com \
storage-component.googleapis.com \
monitoring.googleapis.com \
logging.googleapis.com \
recommender.googleapis.com \
serviceusage.googleapis.com \
bigquery.googleapis.com \
iamcredentials.googleapis.com \
sts.googleapis.com \
container.googleapis.com \
sqladmin.googleapis.com
Step 2: Create a dedicated service account
Create a service account used only for this connection, rather than reusing an existing one, so it is straightforward to audit and to remove.
export SA_NAME="jetscale-readonly-integration"
export SA_EMAIL="${SA_NAME}@${PROJECT_ID}.iam.gserviceaccount.com"
gcloud iam service-accounts create "$SA_NAME" \
--display-name="Jetscale Read-Only Integration" \
--description="Read-only service account for Jetscale cost optimization"
In the console, the same thing is IAM & Admin → Service Accounts → Create service account. Record the full service account email either way.
Step 3: Grant the requested roles
Grant the roles listed on the GCP permissions page to the service account, using either the predefined roles or the custom role definition. Compare that list with the one your Jetscale contact supplies and grant that version.
To cover several projects from one setup, grant at folder or organization scope instead of per project.
Grant roles/billing.viewer on every billing account in scope, or once at
organization level. Projects under a billing account that was missed will link
without cost data:
gcloud billing accounts add-iam-policy-binding [BILLING_ACCOUNT_ID] \
--member="serviceAccount:${SA_EMAIL}" \
--role="roles/billing.viewer"
Step 4: Enable the FOCUS cost export
Cost data is read from a Cloud Billing FOCUS export in BigQuery. Without the export, projects link but no cost data is available.
- In Billing → Billing export → BigQuery export, enable the FOCUS export to a
dataset you control, for example
focus_billing_export. This requires Billing Account Administrator permissions and cannot be done with the service account. - Grant the service account
roles/bigquery.dataVieweron the export dataset, androles/bigquery.jobUser,roles/bigquery.metadataViewer, androles/browseron the export project. - Repeat for each billing account, since each one has its own export.
Step 5: Create a Workload Identity Pool
In the console, go to IAM & Admin → Workload Identity Federation → Create pool.
Give it a name such as jetscale-wif-pool, leave it enabled, and continue to
the provider screen.
Step 6: Register Jetscale as an OIDC provider
The provider inside the pool tells Google Cloud which token issuer to trust.
- Choose OpenID Connect (OIDC).
- Set the provider name, for example
jetscale. - Set the issuer URL to the one your Jetscale contact supplied.
- Leave the default audience unless Jetscale asked for a specific one.
- Under attribute mapping, map
google.subjecttoassertion.sub. - Save, then copy the provider resource name:
projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/providers/PROVIDER_ID
Step 7: Allow impersonation of the service account
This binding lets the federated identity act as the service account you created.
- Open the service account from Step 2 and choose Permissions → Grant access.
- Enter the principal that matches Jetscale's subject claim:
principal://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/subject/JETSCALE_SUBJECT - Assign Service Account Token Creator
(
roles/iam.serviceAccountTokenCreator) and save.
Step 8: Return the connection details
Send the following through the secure channel agreed during onboarding:
- The Workload Identity provider resource name from Step 6.
- The service account email from Step 2.
- The BigQuery project and dataset holding the FOCUS export.
Step 9: Verify
Confirm the setup before treating the project as connected:
- Ask your Jetscale contact to confirm the connection and report anything missing, such as a billing account without an export.
- Check Cloud Audit Logs for activity by the service account, so you can see the access in your own audit trail.
Related
- GCP permissions — the requested access, in full.
- Security and trust — the access model in conceptual terms.