Overview
Use the Google Drive integration after the shared GCP setup to ingest selected shared drives. The current Google Drive integration supports shared drives only, with real-time change ingestion, an initial backfill, and scheduled watch renewal.Before you start
- Run the shared GCP setup first with
./cloud-providers/gcp/scripts/init.sh. - Install Terraform
>= 1.9,gcloud,jq,curl,openssl, andpython3. - Make sure the Google account you will use for the OAuth flow has access to every shared drive you want to ingest.
- If the OAuth client lives in a different GCP project than the base install, enable the Google Drive API in that OAuth project before you run the installer.
- If you have more than one generated GCP install under
generated/gcp/, decide whichinstall-state.jsonyou want to use and pass it with--install-state PATH. - Use a GCP identity that can create Google Drive integration resources and deploy the Google Drive workloads.
Fill install.yaml
The Google Drive installer reads cloud-providers/gcp/scripts/integrations/google-drive/install.yaml by default.
Google Drive inherits the hosting mode, project ID, region, and other shared values from the base install-state.json. You do not set those again here.
Fill in these fields:
google_drive.drives: required. Use shared-drive IDs or exact shared-drive names.- In
self-hosting, setgoogle_drive.oauth.client_idandgoogle_drive.oauth.client_secretbefore the first install. Later reruns can omit them only if the installer already stored the app secret in Secret Manager. google_drive.oauth.state_secretis optional if you want to set it yourself.- In
cloud-hosting, usually leavegoogle_drive.oauth.*blank and set:ASYMPTOTE_GOOGLE_DRIVE_CLIENT_IDASYMPTOTE_GOOGLE_DRIVE_CLIENT_SECRET- Optional:
ASYMPTOTE_GOOGLE_DRIVE_STATE_SECRET
- The remaining
google_drive.*fields are optional naming overrides for Google Drive-specific resources and jobs.
Hosting modes
Self-hosting mode
Use basemode: self-hosting.
- The first install uses a customer-owned Google OAuth client and stores the normalized app and installation details in Secret Manager.
- The Google account that completes the OAuth flow must have access to every shared drive listed in
google_drive.drives. - If the OAuth client is created in the same GCP project as the base install, Terraform enables
drive.googleapis.comautomatically. Otherwise, enable the Google Drive API manually in the OAuth client project before you run the installer.
Create the Google OAuth client in Google Cloud Console
Create the OAuth client before the first self-hosted install, then copy its client ID and secret intoinstall.yaml.
Open the Google Cloud project that will own the OAuth client
Use the Google Cloud project where you want the Google OAuth client to live. If this is not the same project as the base GCP install, make sure the Google Drive API is enabled in that OAuth client project before you continue.
Go to `APIs & Services` > `Credentials`
In the Google Cloud Console, open the
Credentials page for that project.Create a new OAuth client ID
Click
Create Credentials, then choose OAuth client ID.If Google prompts you to configure the OAuth consent screen first, complete that setup for your organization, then return to the Credentials page.Choose the client type and redirect URI
Set
Application type to Web application.Give the client a descriptive name such as asymptote-google-drive.Under Authorized redirect URIs, add:Cloud-hosting mode
Use basemode: cloud-hosting.
- Use the Asymptote-managed Google OAuth client instead of creating your own.
- Before you run the installer, export:
ASYMPTOTE_GOOGLE_DRIVE_CLIENT_IDASYMPTOTE_GOOGLE_DRIVE_CLIENT_SECRET
- Optional:
ASYMPTOTE_GOOGLE_DRIVE_STATE_SECRET
Run the installer
Update `cloud-providers/gcp/scripts/integrations/google-drive/install.yaml`
Fill in the shared drives you want to ingest and any Google Drive-specific settings you need.
What happens at a high level
After the Google Drive setup completes successfully:- The selected shared drives are connected to the integration.
- The customer-owned Google OAuth client is used or reused in
self-hosting, or the Asymptote-managed client is used incloud-hosting. - The Google Drive webhook ingress, Pub/Sub ingest function, backfill job, and watch-renewal job are deployed.
- An initial historical backfill is triggered.
- Extracted text snapshots are stored in GCS, while metadata and object references are written to PostgreSQL.
Add drives later
If Google Drive is already connected and you want to add more shared drives, update the existing Google Drive integration instead of rerunning the base GCP setup.Update `google_drive.drives`
Edit
cloud-providers/gcp/scripts/integrations/google-drive/install.yaml and keep the full set of shared drives you want connected. Add the new shared drives to google_drive.drives rather than replacing the existing list unless you want to remove drives from the integration.Confirm drive access
Make sure the Google account used by the integration can access every shared drive listed in
google_drive.drives, including the newly added ones.google_drive.drives and accessible to the Google account that authorized the integration.
Troubleshooting
- If the installer cannot find the base setup you want, pass
--install-state /path/to/install-state.json. - If you are using
cloud-hosting, make sureASYMPTOTE_GOOGLE_DRIVE_CLIENT_IDandASYMPTOTE_GOOGLE_DRIVE_CLIENT_SECRETare set before running the installer. - If the OAuth flow succeeds but the installer says it cannot access any selected shared drives, make sure the Google account that authorized the app can open each drive listed in
google_drive.drives. - If the Google Drive OAuth exchange does not return a
refresh_token, revoke the prior grant for that app in Google and rerun the installer. - If the OAuth client lives in a separate GCP project, make sure the Google Drive API is enabled in that project.

