090. CLI로 처리하기 (Processing through CLI)
- 원문: English
- 위치: Additional capabilities › Data Automation › Using Amazon Bedrock Data Automation CLI › Processing through CLI
한 줄 요약
aws bedrock-data-automation-runtime의 invoke-data-automation-async(비동기)와 invoke-data-automation(동기)에 붙일 수 있는 옵션별 사용법(비디오 구간, 블루프린트 직접 지정, KMS 암호화, EventBridge 알림, 태그, 바이트 입력)을 정리합니다.
핵심 내용
사전 준비
- 처리할 파일을 S3에 업로드:
aws s3 cp /local/path/document.pdf s3://my-bda-bucket/input/document.pdf
비동기 (invoke-data-automation-async) 옵션
| 옵션 | 용도 |
|---|
--input-configuration | s3Uri. 비디오는 assetProcessingConfiguration.video.segmentConfiguration.timestampSegment(startTimeMillis, endTimeMillis)로 구간 지정 |
--output-configuration | 결과 S3 위치 |
--data-automation-configuration | 프로젝트 ARN + stage |
--blueprints | 프로젝트 대신 블루프린트를 직접 지정(blueprintArn, version, stage) |
--encryption-configuration | kmsKeyId, kmsEncryptionContext |
--notification-configuration | eventBridgeConfiguration.eventBridgeEnabled: true → 완료 알림 |
--tags | 처리 작업 태그(key/value) |
--data-automation-profile-arn | ⚠️ 모든 처리 요청에 필수 |
- 상태 확인:
get-data-automation-status --invocation-arn → COMPLETED 등 + outputLocation
출력 구조 (원문 기준 “일반적으로”)
| 파일 | 내용 |
|---|
standard-output.json | 표준 추출 결과 |
custom-output.json | 커스텀 블루프린트 결과 |
metadata.json | 처리 메타데이터, 신뢰도 점수 |
- 표준 출력 공통 필드:
extractedData, confidence, metadata, boundingBoxes(활성 시)
자주 나는 오류
| 오류 | 조치 |
|---|
| Invalid S3 URI | 버킷 존재·권한 확인 |
Missing data-automation-profile-arn | 필수 파라미터이므로 추가 |
| Project not found | 프로젝트 ARN 확인 |
| Unsupported file format | 지원 형식 확인 → 087 |
동기 (invoke-data-automation) 옵션
| 용도 | 방법 |
|---|
| 기본 | --input-configuration(S3) + 프로젝트 설정 + 프로필 ARN + --region |
| S3로 출력 | --output-configuration 추가 (원문 주석: “document only”) |
| 바이트 입력 | --input-configuration '{"bytes": ...}' — base64 인코딩, 최대 50MB |
| 커스텀 블루프린트 직접 지정 | --blueprints — ⚠️ 이미지 전용 |
📝 출력 파일 구성과 필드명은 원문에서 “일반적으로(typically)“라고만 설명합니다. 실제 구조는 037 표준 출력을 함께 보세요.
SA 관점
--data-automation-profile-arn 누락이 가장 흔한 실수입니다. 래퍼 스크립트/SDK 코드에서 기본값으로 넣어 두세요.- 규제 고객이면
--encryption-configuration(고객 관리형 KMS 키 + 암호화 컨텍스트)을 기본 템플릿에 포함하세요.