Skip to content

Cloud & infrastructure

Connect a GCP project keylessly via Workload Identity federation and a Cloud Shell script.

Google Cloud connects keylessly — one Cloud Shell command sets up Workload Identity federation that trusts Dave’s own cloud identity. No service-account key is created or stored.

  1. In the Google Cloud console, open the project picker and copy the Project ID — the lowercase string like acme-prod, not the display name or the numeric project number.

  2. In Dave, go to Integrations → Add integration → Google Cloud.

  3. Paste the Project ID.

  4. Set a Label — see labels.

  5. Choose Connect GCP Project. Dave shows a one-line setup command.

  6. Open Cloud Shell and confirm the project:

    Terminal window
    gcloud config get-value project
    gcloud config set project YOUR_PROJECT_ID
  7. Paste and run the command. It fetches and runs Dave’s setup script, which prints each step. To read the script first, open the URL in the command in a browser.

  8. The script reports the project number back to Dave. Dave finishes connecting once the Workload Identity binding propagates, which can take a few minutes.

The setup script enables these APIs on the project:

iam.googleapis.com
iamcredentials.googleapis.com
sts.googleapis.com
cloudresourcemanager.googleapis.com
cloudasset.googleapis.com

It creates these resources:

Resource Name
Workload Identity pool dave-pool (display name Dave WIF)
AWS provider in that pool dave-aws
Service account dave-agent@PROJECT_ID.iam.gserviceaccount.com (display name Dave Agent)

The provider trusts Dave’s AWS account, and its attribute condition admits only Dave’s federation role:

attribute.aws_role=='<Dave federation role ARN>'

Then it grants two roles. On the service account, so the federated identity can impersonate it:

roles/iam.workloadIdentityUser

On the project, for the service account:

roles/viewer

roles/viewer is Google’s basic read-only role — it reads most resources across the project, but cannot change anything. To narrow it, replace that binding with a custom role after setup.

Whoever runs the script needs to enable APIs, create Workload Identity pools and service accounts, and set IAM policy on the project — Owner covers all of it.

To review what Dave has, open IAM & Admin in the project:

  • IAM — the dave-agent@ service account with Viewer.
  • Service Accounts — dave-agent.
  • Workload Identity Federation — the dave-pool pool and its dave-aws provider.

Disconnect in Dave stops Dave using the project immediately, but does not delete anything — Dave only holds a read-only role, so it cannot remove the pool, provider, or service account itself. After you disconnect, Dave shows a one-line cleanup command: run it in Cloud Shell. It removes the roles/viewer binding, deletes the service account, then deletes the pool together with its provider. It prints each step and is safe to re-run. Dave checks every few seconds and finishes disconnecting once the access is gone.

A deleted pool’s name stays reserved for 30 days. Connecting the same project again in that window restores the pool instead of creating a new one.

Cancelling an unfinished setup removes the pending project from Dave only — anything the script already created stays until you delete it.

  • Validation takes long — confirm the setup script ran to completion without errors. It is safe to re-run.
  • GCP rejects the connection — check the project ID, re-run the setup script in that project, then choose Connect again.