146. Google Drive 데이터 소스 연결 (Connect a data source)
- 원문: English
- 위치: Additional capabilities › Knowledge Bases › Build a managed knowledge base › Create a managed knowledge base › Connect a data source › Google Drive › Connect a data source
한 줄 요약
콘솔 또는 CreateDataSource로 type = GOOGLEDRIVE, version = 1 데이터 소스를 만듭니다. aclEnabled는 생략 시 SERVICE_ACCOUNT면 true 이고 생성 후 바꿀 수 없으므로 명시하세요. 인증 방식은 UpdateDataSource로 변경 가능합니다.
쉽게 말하면
내 드라이브/공유받은 파일/공유 드라이브 중 무엇을 긁을지 고르고, 공유 드라이브 ID·MIME·날짜·크기로 범위를 좁힙니다. 특정 폴더·파일 ID 지정은 OAuth 2.0에서만 됩니다.
핵심 내용
콘솔 요점
- Authentication: Google service account 또는 OAuth 2.0
- (서비스 계정만) Control document access with ACLs — 생성 후 변경 불가
- Sync scope: My Drive, Shared with me, Shared drives
- Shared drives ID 포함/제외, (OAuth만) Specific folders and files, MIME 타입 정규식 패턴, 날짜 기반 동기화
API 예시
{
"type": "MANAGED_KNOWLEDGE_BASE_CONNECTOR",
"managedKnowledgeBaseConnectorConfiguration": {
"connectorParameters": {
"type": "GOOGLEDRIVE", "version": "1", "aclEnabled": false,
"connectionConfiguration": { "secretArn": "arn:aws:secretsmanager:...", "authType": "SERVICE_ACCOUNT" },
"dataEntityConfiguration": { "crawlMyDrive": true, "crawlSharedWithMe": true, "crawlSharedDrives": false },
"filterConfiguration": { "inclusionMimeTypes": ["application/pdf"] }
}
}
}
CreateDataSource는 비동기(CREATING→AVAILABLE). 감싸는 필드는 → 116
커넥터 파라미터
| 구분 | 필드 | 설명 |
|---|---|---|
| connection | secretArn (필수), authType (필수) | SERVICE_ACCOUNT(권장) / OAUTH2 |
| dataEntity (선택) | crawlMyDrive, crawlSharedWithMe, crawlSharedDrives | 내 드라이브 / 공유받은 파일 / 공유 드라이브 |
| filter | inclusionSharedDriveIds / exclusionSharedDriveIds | 공유 드라이브 ID |
| filter | inclusionMimeTypes / exclusionMimeTypes | MIME 타입 |
| filter (OAuth만) | inclusionFolderIds, inclusionFileIds, inclusionSharedFolderIds, inclusionSharedFileIds | 특정 폴더·파일 ID |
| filter | modifiedDateBefore / modifiedDateAfter | ISO 8601. Before가 After보다 이르면 아무것도 매칭 안 됨 |
| filter | maxFileSizeInMegaBytes | 숫자 문자열, 기본 "500" |
| - | aclEnabled | 생략 시 SERVICE_ACCOUNT=true, OAUTH2=false. ACL은 SERVICE_ACCOUNT 필요. 생성 후 변경 불가 |
인증 방식 변경
UpdateDataSource(또는 콘솔)로 새authType+ 맞는 자격 증명의 시크릿을 지정하면 변경됩니다 (예: OAuth 2.0 → 서비스 계정).- ⚠️ 단, ACL 설정은 생성 시 고정이라 ACL을 추가/제거하려면 새 데이터 소스를 만들어야 합니다.
다음 단계
SA 관점
- OAuth로 PoC 후 서비스 계정으로 전환하는 경로는 가능하지만, ACL이 필요하면 결국 데이터 소스를 새로 만들어 재수집해야 합니다. 운영 목표가 ACL이면 처음부터 서비스 계정 +
aclEnabled: true로 시작하세요. - 📝 Dropbox 커넥터와 달리 원문 예시에
connectorType필드가 없습니다.