marmotdata/googledrive
Discover folders, files and spreadsheets from Google Drive
The Google Drive plugin catalogues the documents and sheets a team keeps in Drive, so the spreadsheet a report is actually built from is findable next to the warehouse tables feeding it.
A drive is imported as a tree: the drive itself at the root, folders nested under it, files linked to the folder holding them. Google Sheets can be imported as spreadsheets, with each sheet under them optionally imported as a table whose header row becomes the columns.
These are the same asset types and names the OpenMetadata plugin produces for a Google Drive service, so an organisation moving off OpenMetadata can import their drive from there and later point this plugin at Drive directly; the second run takes over the assets already in the catalog rather than creating a second copy.
Access
The plugin reads Drive with a Google service account.
A service account on its own only sees files that have been shared with its email address, which is a reasonable way to catalogue a handful of shared folders. To read a whole organisation's Drive, give the service account domain-wide delegation and set impersonate_user to a Workspace user to act as.
Enable the Google Drive API, and the Google Sheets API if you want the columns of each sheet. The scopes needed are:
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/spreadsheets.readonly
Credentials follow Marmot's shared Google Cloud configuration: a key file, key JSON, or Application Default Credentials when nothing is set.
Keyless authentication
On Marmot Cloud or Marmot Enterprise the pipeline can present its own identity instead of a service account key. Set credentials.workload_identity_provider to a Workload Identity Federation provider that trusts your Marmot instance as an OIDC issuer, and grant the pipeline's subject, pipeline:<name> as reported by the pipeline API, the role above directly (principal://iam.googleapis.com/<pool>/subject/pipeline:<name>), or grant it roles/iam.workloadIdentityUser on a service account named in credentials.service_account. No key exists anywhere; Marmot mints a short-lived token for each run.
In the UI
Point and click, no config file needed.
- Open Runs and choose Create pipeline.
- Pick Google Drive from the plugin list.
- Fill in the settings, set a schedule and save.
With the CLI
Save a YAML config, then run marmot ingest.
Not using plugins? Other ways to populate Marmot
Configuration
Fields marked Required must be set.
tagsList of textTags to apply to discovered assets
external_linksList of groupsExternal links to show on all assets
nameTextDisplay name for the link
iconTextIcon identifier for the link
urlTextURL to the external resource
filterGroup of settingsFilter discovered assets by name (regex)
includeList of textInclude patterns for resource names (regex)
excludeList of textExclude patterns for resource names (regex)
zoneTextTells this system apart from others of the same technology and becomes part of every asset's MRN
credentialsGroup of settingsGCP credentials configuration
credentials_jsonSecretService account key JSON content
credentials_fileTextPath to a service account key JSON file
workload_identity_providerTextWorkload Identity Federation provider to exchange the Marmot identity token at, projects/<number>/locations/global/workloadIdentityPools/<pool>/providers/<provider>. Setting it federates: the pipeline presents a Marmot identity token and no key is needed; bind the pipeline's subject on the Google Cloud side
service_accountTextService account to impersonate after the exchange; empty acts as the federated principal directly
audienceTextAudience of the Marmot identity token. Derived from the credentials' federation settings; set it only when the cloud side expects another
impersonate_userTextWorkspace user to act as. Needed to read a whole organisation's Drive, and requires domain-wide delegation on the service account. Without it, only files shared with the service account are visible
drive_idTextShared drive to read. Empty means the user's My Drive
folder_idTextOnly discover this folder and everything under it
include_filesYes or noDiscover files, not just folders
include_spreadsheetsYes or noDiscover Google Sheets, including each of their sheets
include_worksheetsYes or noDiscover each sheet of a spreadsheet as a table, with its columns. Needs the Sheets read scope
include_trashedYes or noDiscover files in the trash
exclude_mime_typesList of textMIME types to skip, for example application/vnd.google-apps.shortcut
max_filesNumberStop after this many files. 0 means no limit
page_sizeNumberFiles per API request
header_rowNumberRow of a sheet that holds the column names
concurrencyNumberParallel requests for the sheets of a spreadsheet