Connect a Google Drive data source
After you set up authentication and store your credentials in an AWS Secrets Manager secret, create the Google Drive data source in your knowledge base. This page describes how to create the data source with the AWS Management Console or the API, followed by a reference for the connector parameters you can configure.
Note
Complete authentication setup first. See Set up service account authentication for Google Drive (recommended) or Set up OAuth 2.0 authentication for Google Drive. You need the secret ARN.
Create the data source
Connector parameters
The data source configuration uses the following connector parameters. To connect
to Google Drive, specify GOOGLEDRIVE as the connector type in
connectorParameters. For the fields that wrap
connectorParameters (such as
deletionProtectionConfiguration and
mediaExtractionConfiguration), see Connect a data source.
Set aclEnabled explicitly
If you omit aclEnabled, the default depends on
authType: SERVICE_ACCOUNT defaults to
true, and OAUTH2 defaults to false.
Because ACL configuration is permanent after the data source is created, set
aclEnabled explicitly so the data source has the access-control
behavior you intend. For details, see Document-level access controls.
| Field | Required | Description |
|---|---|---|
secretArn |
Yes | The ARN of the AWS Secrets Manager secret containing your Google Drive credentials. |
authType |
Yes | The authentication type: SERVICE_ACCOUNT
(recommended) or OAUTH2. See Authentication methods. |
| Field | Required | Description |
|---|---|---|
crawlMyDrive |
No | Whether to crawl the authenticated user's personal drive. |
crawlSharedWithMe |
No | Whether to crawl files shared with the authenticated user. |
crawlSharedDrives |
No | Whether to crawl shared drives. |
| Field | Required | Description |
|---|---|---|
inclusionSharedDriveIds |
No | Shared drive IDs to include. |
exclusionSharedDriveIds |
No | Shared drive IDs to exclude. |
inclusionMimeTypes |
No | MIME types to include. |
exclusionMimeTypes |
No | MIME types to exclude. |
inclusionFolderIds |
No | Folder IDs to include. Available only with
OAUTH2 authentication. |
inclusionFileIds |
No | File IDs to include. Available only with
OAUTH2 authentication. |
inclusionSharedFolderIds |
No | Shared folder IDs to include. Available only with
OAUTH2 authentication. |
inclusionSharedFileIds |
No | Shared file IDs to include. Available only with
OAUTH2 authentication. |
modifiedDateBefore |
No | Only include content modified before this date (ISO 8601). |
modifiedDateAfter |
No | Only include content modified after this date (ISO 8601). If
modifiedDateBefore is earlier than
modifiedDateAfter, no content matches the
window. |
maxFileSizeInMegaBytes |
No | Maximum size, in megabytes, of any single file the connector
ingests. Provide as a numeric string (for example,
"500"). Defaults to "500". |
| Field | Required | Description |
|---|---|---|
aclEnabled |
No | Whether document-level access control is enabled. Set to
true to enable, or false to disable. If
you omit this field, the default depends on authType:
SERVICE_ACCOUNT defaults to true;
OAUTH2 defaults to false. ACL requires
SERVICE_ACCOUNT authentication. You cannot change
this setting after you create the data source. For details, see
Document-level access controls. |
Change the authentication method
You can change a data source's authentication method (for example, from OAuth 2.0
to service account) by updating the data source with the new authType
and a secret that contains the matching credentials, using the UpdateDataSource operation or the AWS Management Console. The document-level access
control setting is fixed when you create a data source, so to add or remove ACLs
you must create a new data source.
Next steps
After you create the data source, sync it to ingest content into your knowledge base. For details, see Sync a data source. To filter query results by user permissions, see Document-level access controls.