

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# Amazon Bedrock 데이터 자동화 CLI 사용
<a name="bda-cli-guide"></a>

 Amazon Bedrock 데이터 자동화(BDA) 기능은 데이터를 처리하기 위한 간소화된 CLI 워크플로를 제공합니다. 모든 양식에서 이 워크플로는 프로젝트 생성, 사용자 지정 출력을 위한 블루프린트 생성, 문서 처리의 세 가지 주요 단계로 구성됩니다. 이 가이드에서는 BDA 작업을 위한 주요 CLI 명령을 안내합니다.

## 첫 번째 데이터 자동화 프로젝트 생성
<a name="create-data-automation-project-cli"></a>

BDA 작업을 시작하려면 먼저 `create-data-automation-project` 명령을 사용하여 프로젝트를 생성합니다.

처리할 이 샘플 여권을 살펴보겠습니다.

![\[alt text not found\]](http://docs.aws.amazon.com/ko_kr/bedrock/latest/userguide/images/bda/passport2.png)


프로젝트를 생성할 때 처리하려는 파일 유형에 대한 구성 설정을 정의해야 합니다. 다음 명령은 이미지 처리 프로젝트를 생성하기 위한 최소 작업 예제를 나타냅니다.

```
aws bedrock-data-automation create-data-automation-project \
    --project-name "ImageProcessingProject" \
    --standard-output-configuration '{
        "image": {
            "extraction": {
                "category": {
                    "state": "ENABLED",
                    "types": ["TEXT_DETECTION"]
                },
                "boundingBox": {
                    "state": "ENABLED"
                }
            },
            "generativeField": {
                "state": "ENABLED"
            }
        }
    }'
```

명령은 입력 구성을 검증하고 고유한 ARN으로 새 프로젝트를 생성합니다. 응답에는 프로젝트 ARN과 단계가 포함됩니다.

```
{
    "projectArn": "Amazon Resource Name (ARN)",
    "projectStage": "DEVELOPMENT",
    "status": "IN_PROGRESS"
}
```

파라미터 없이 프로젝트가 생성되면 기본 설정이 적용됩니다. 예를 들어 이미지를 처리할 때 이미지 요약 및 텍스트 감지가 기본적으로 활성화됩니다.

## 전체 파라미터 참조
<a name="create-project-parameters"></a>

다음 테이블은 `create-data-automation-project` 명령에 사용 가능한 모든 파라미터를 보여 줍니다.


**create-data-automation-project에 대한 파라미터**  

| 파라미터 | 필수 | 기본값 | 설명 | 
| --- | --- | --- | --- | 
| --project-name | 예 | 해당 사항 없음 | 데이터 자동화 프로젝트의 이름 | 
| --project-type | 아니요 | 프로젝트 유형은 사용할 수 있는 런타임 처리 API를 정의합니다. ASYNC 프로젝트는 invoke-bedrock-data-automation-async API에서만 사용할 수 있는 반면 프로젝트는 invoke-bedrock-data-automation API에서만 사용할 수 SYNC 있습니다. | 
| --project-stage | 아니요 | LIVE | 프로젝트 단계(개발 또는 라이브) | 
| --standard-output-configuration | 예 | 해당 사항 없음 | 표준 출력 처리를 위한 JSON 구성 | 
| --custom-output-configuration | 아니요 | 해당 사항 없음 | 사용자 지정 출력 처리를 위한 JSON 구성 | 
| --encryption-configuration | 아니요 | 해당 사항 없음 | 프로젝트의 암호화 설정 | 
| --client-token | 아니요 | 자동 생성됨 | 요청 멱등성을 위한 고유 식별자 | 

## 블루프린트 생성
<a name="create-blueprint-cli"></a>

프로젝트를 생성한 후 `create-blueprint` 명령을 사용하여 블루프린트를 생성하고 데이터 처리 구조를 정의할 수 있습니다.

다음은 여권 처리에 맞는 블루프린트를 생성하는 최소 작업 예제입니다.

```
aws bedrock-data-automation create-blueprint \
    --blueprint-name "passport-blueprint" \
    --type "IMAGE" \
    --blueprint-stage "DEVELOPMENT" \
    --schema '{
        "class": "Passport",
        "description": "Blueprint for processing passport images",
        "properties": {
            "passport_number": {
                "type": "string",
                "inferenceType": "explicit",
                "instruction": "The passport identification number"
            },
            "full_name": {
                "type": "string",
                "inferenceType": "explicit",
                "instruction": "The full name of the passport holder"
            }
        }
    }'
```

명령은 지정된 스키마를 사용하여 새 블루프린트를 생성합니다. 그런 다음 문서를 처리할 때 이 블루프린트를 사용하여 정의된 스키마에 따라 구조화된 데이터를 추출할 수 있습니다.

## 블루프린트 사용
<a name="using-blueprint-cli"></a>

### 프로젝트에 블루프린트 추가
<a name="adding-blueprint-to-project"></a>

프로젝트에 블루프린트를 추가하려면 `update-data-automation-project` 명령을 사용합니다.

```
aws bedrock-data-automation update-data-automation-project \
    --project-arn "Amazon Resource Name (ARN)" \
    --standard-output-configuration '{
        "image": {
            "extraction": {
                "category": {
                    "state": "ENABLED",
                    "types": ["TEXT_DETECTION"]
                },
                "boundingBox": {
                    "state": "ENABLED"
                }
            },
            "generativeField": {
                "state": "ENABLED",
                "types": ["IMAGE_SUMMARY"]
            }
        }
    }' \
    --custom-output-configuration '{
        "blueprints": [
            {
                "blueprintArn": "Amazon Resource Name (ARN)",
                "blueprintVersion": "1",
                "blueprintStage": "LIVE"
            }
        ]
    }'
```

### 블루프린트 통합 확인
<a name="verifying-blueprint-integration"></a>

`get-data-automation-project` 명령을 사용하여 블루프린트 통합을 확인할 수 있습니다.

```
aws bedrock-data-automation get-data-automation-project \
    --project-arn "Amazon Resource Name (ARN)"
```

### 여러 블루프린트 관리
<a name="managing-multiple-blueprints"></a>

`list-blueprints` 명령을 사용하여 모든 블루프린트를 봅니다.

```
aws bedrock-data-automation list-blueprints
```

## 비동기식으로 문서 처리
<a name="invoke-data-automation-cli"></a>

BDA로 문서를 처리하기 전에 먼저 S3 버킷에 문서를 업로드해야 합니다. 프로젝트가 설정되면 `invoke-data-automation-async` 명령을 사용하여 문서를 처리할 수 있습니다.

```
aws bedrock-data-automation-runtime invoke-data-automation-async \
    --input-configuration '{
        "s3Uri": "s3://my-bda-documents/invoices/invoice-123.pdf"
    }' \
    --output-configuration '{
        "s3Uri": "s3://my-bda-documents/output/"
    }' \
    --data-automation-configuration '{
        "dataAutomationProjectArn": "Amazon Resource Name (ARN)",
        "stage": "LIVE"
    }' \
    --data-automation-profile-arn "Amazon Resource Name (ARN)"
```

명령은 처리 상태를 확인하는 데 사용할 수 있는 간접 호출 ARN을 반환합니다.

```
{
    "invocationArn": "Amazon Resource Name (ARN)"
}
```

## 처리 상태 확인
<a name="get-data-automation-status-cli"></a>

처리 작업의 상태를 확인하려면 `get-data-automation-status` 명령을 사용합니다.

```
aws bedrock-data-automation-runtime get-data-automation-status \
    --invocation-arn "Amazon Resource Name (ARN)"
```

명령은 처리 작업의 현재 상태를 반환합니다.

```
{
    "status": "COMPLETED",
    "creationTime": "2025-07-09T12:34:56.789Z",
    "lastModifiedTime": "2025-07-09T12:45:12.345Z",
    "outputLocation": "s3://my-bda-documents/output/efgh5678/"
}
```

가능한 상태 값에는 다음이 포함됩니다.
+ `IN_PROGRESS`: 처리 작업이 현재 실행 중입니다.
+ `COMPLETED`: 처리 작업이 성공적으로 완료되었습니다.
+ `FAILED`: 처리 작업이 실패했습니다. 오류 세부 정보는 응답을 확인하세요.
+ `STOPPED`: 처리 작업이 수동으로 중지되었습니다.

## 결과 검색
<a name="retrieve-results-cli"></a>

처리가 완료되면 S3 버킷의 출력 파일을 나열할 수 있습니다.

```
aws s3 ls s3://my-bda-documents/output/efgh5678/
```

결과를 로컬 시스템에 다운로드하려면 다음을 수행합니다.

```
aws s3 cp s3://my-bda-documents/output/efgh5678/ ~/Downloads/bda-results/ --recursive
```

출력에는 프로젝트 구성 및 적용한 블루프린트를 기반으로 하는 구조화된 데이터가 포함됩니다.

## 문서를 동기식으로 처리
<a name="process-docs-sync"></a>

BDA로 문서를 처리하기 전에 먼저 S3 버킷에 문서를 업로드해야 합니다. 동기화 API는 S3 버킷 또는 이미지 바이트를 통해 입력을 모두 가져옵니다(예: S3 없이 문서 처리). 명령은 프로젝트 구성과 적용한 블루프린트를 기반으로 구조화된 데이터를 반환합니다.

```
aws bedrock-data-automation-runtime invoke-data-automation \
    --input-configuration '{
        "s3Uri": "s3://my-bda-documents/invoices/invoice-123.pdf"
    }' \
    --data-automation-configuration '{
        "dataAutomationProjectArn": "Amazon Resource Name (ARN)",
        "stage": "LIVE"
    }' \
    --data-automation-profile-arn "Amazon Resource Name (ARN)"
```

## 이미지를 동기식으로 처리
<a name="process-images-sync"></a>

명령은 프로젝트 구성과 적용한 블루프린트를 기반으로 구조화된 데이터를 반환합니다.

```
aws bedrock-data-automation-runtime invoke-data-automation \
    --input-configuration '{
        "s3Uri": "s3://my-bda-documents/invoices/advertisement_latest.jpeg"
    }' \
    --data-automation-configuration '{
        "dataAutomationProjectArn": "Amazon Resource Name (ARN)",
        "stage": "LIVE"
    }' \
    --data-automation-profile-arn "Amazon Resource Name (ARN)"
```

# 블루프린트 작업 CLI
<a name="bda-blueprint-operations"></a>

이 가이드에서는 Amazon Bedrock데이터 자동화(BDA)를 위한 AWS 명령줄 인터페이스(CLI)를 통해 사용할 수 있는 블루프린트 작업을 다룹니다.

## 블루프린트 생성
<a name="create-blueprints-cli"></a>

블루프린트는 문서, 이미지, 오디오 또는 비디오 파일에서 추출하려는 데이터의 구조와 속성을 정의합니다. create-blueprint 명령을 사용하여 새 블루프린트를 정의합니다.

다음 명령은 여권 이미지에서 데이터를 추출하도록 조정된 새 블루프린트를 생성합니다.

**구문**

```
aws bedrock-data-automation create-blueprint \
      --blueprint-name "passport-blueprint" \
      --type "IMAGE" \
      --blueprint-stage "DEVELOPMENT" \
      --schema '{
        "class": "Passport",
        "description": "Blueprint for processing passport images",
        "properties": {
          "passport_number": {
            "type": "string",
            "inferenceType": "explicit",
            "instruction": "The passport identification number"
          },
          "full_name": {
            "type": "string",
            "inferenceType": "explicit",
            "instruction": "The full name of the passport holder"
          },
          "expiration_date": {
            "type": "string",
            "inferenceType": "explicit",
            "instruction": "The passport expiration date"
          }
        }
      }'
```

## 전체 파라미터 참조
<a name="create-blueprint-parameters"></a>

다음 테이블은 `create-blueprint` 명령에 사용 가능한 모든 파라미터를 보여 줍니다.


**create-blueprint용 파라미터**  

| 파라미터 | 필수 | 기본값 | 설명 | 
| --- | --- | --- | --- | 
| --blueprint-name | 예 | 해당 사항 없음 | 블루프린트 이름 | 
| --type | 예 | 해당 사항 없음 | 콘텐츠 유형(이미지, 문서, 오디오, 비디오) | 
| --blueprint-stage | 아니요 | LIVE | 블루프린트 단계(개발 또는 라이브) | 
| --schema | 예 | 해당 사항 없음 | 블루프린트 구조를 정의하는 JSON 스키마 | 
| --client-token | 아니요 | 자동 생성됨 | 요청 멱등성을 위한 고유 식별자 | 

## 블루프린트 구성 보기
<a name="view-blueprint-cli"></a>

**모든 블루프린트 나열**

list-blueprints 명령을 사용하여 계정에 연결된 모든 블루프린트 목록을 검색합니다.

**구문**

```
aws bedrock-data-automation list-blueprints
```

**블루프린트 세부 정보 보기**

스키마 및 구성을 포함하여 특정 블루프린트에 대한 자세한 정보를 보려면 get-blueprint 명령을 사용합니다.

**구문**

```
aws bedrock-data-automation get-blueprint \
      --blueprint-arn "Amazon Resource Name (ARN)"
```

**특정 버전 검사**

버전이 지정된 블루프린트로 작업할 때는 get-blueprint 명령을 --blueprint-version 옵션과 함께 사용하여 특정 버전을 확인합니다.

**구문**

```
      aws bedrock-data-automation get-blueprint \
      --blueprint-arn "Amazon Resource Name (ARN)" \
      --blueprint-version "version-number"
```

**특정 단계 검사**

개발 또는 라이브 단계에서 블루프린트를 보려면 다음을 사용합니다.

```
      aws bedrock-data-automation get-blueprint \
      --blueprint-arn "Amazon Resource Name (ARN)" \
      --blueprint-stage "LIVE"
```

## 블루프린트 사양 편집
<a name="edit-blueprint-cli"></a>

**블루프린트 설정 업데이트**

기존 블루프린트의 스키마 또는 속성을 수정하려면 update-blueprint 명령을 사용합니다.

**구문**

```
aws bedrock-data-automation update-blueprint \
      --blueprint-arn "Amazon Resource Name (ARN)" \
      --schema '{
        "class": "Passport",
        "description": "Updated blueprint for processing passport images",
        "properties": {
          "passport_number": {
            "type": "string",
            "inferenceType": "explicit",
            "instruction": "The passport identification number"
          },
          "full_name": {
            "type": "string",
            "inferenceType": "explicit",
            "instruction": "The full name of the passport holder"
          },
          "expiration_date": {
            "type": "string",
            "inferenceType": "explicit",
            "instruction": "The passport expiration date"
          }
        }
      }'
```

**참고:** 블루프린트를 업데이트할 때는 변경하지 않는 필드에도 전체 스키마를 제공해야 합니다.

**라이브로 승격**

프로덕션을 위해 블루프린트를 개발 단계에서 라이브 단계로 이동하려면 update-blueprint 명령을 --blueprint-stage 옵션과 함께 사용합니다.

**구문**

```
aws bedrock-data-automation update-blueprint \
      --blueprint-arn "Amazon Resource Name (ARN)" \
      --blueprint-stage "LIVE"
```

**블루프린트 버전 관리**

create-blueprint-version 명령을 사용하여 크게 변경하기 전에 블루프린트의 새 버전을 생성하여 현재 상태를 유지합니다.

**구문**

```
aws bedrock-data-automation create-blueprint-version \
      --blueprint-arn "Amazon Resource Name (ARN)"
```

## 블루프린트 태그 관리
<a name="tag-management-cli"></a>

태그는 사용자가 블루프린트를 구성 및 분류하여 관리를 단순화하는 데 도움이 됩니다.

**태그 추가**

태그를 추가하여 블루프린트에 메타데이터를 적용합니다.

**구문**

```
aws bedrock-data-automation tag-resource \
      --resource-arn "Amazon Resource Name (ARN)" \
      --tags '{"Department":"Finance","Project":"PassportProcessing"}'
```

**태그 제거**

untag-resource 명령을 사용하여 블루프린트에서 특정 태그를 제거합니다.

**구문**

```
aws bedrock-data-automation untag-resource \
      --resource-arn "Amazon Resource Name (ARN)" \
      --tag-keys '["Department","Project"]'
```

**태그 보기**

list-tags-for-resource 명령을 사용하여 블루프린트에 연결된 모든 태그를 나열합니다.

**구문**

```
aws bedrock-data-automation list-tags-for-resource \
      --resource-arn "Amazon Resource Name (ARN)"
```

## 블루프린트 삭제
<a name="delete-blueprint-cli"></a>

**전체 블루프린트 삭제**

delete-blueprint 명령을 사용하여 블루프린트와 모든 버전을 영구적으로 제거합니다.

**구문**

```
aws bedrock-data-automation delete-blueprint \
          --blueprint-arn "Amazon Resource Name (ARN)"
```

**주의:** 이 명령을 사용하면 블루프린트가 영구적으로 삭제되며 복구할 수 없습니다.

**중요:** 현재 프로젝트에서 사용 중인 블루프린트는 삭제할 수 없습니다. 삭제하기 전에 프로젝트의 사용자 지정 출력 구성에서 블루프린트가 참조되지 않았는지 확인하세요.

## 블루프린트 최적화
<a name="blueprint-optimization-cli"></a>

### 블루프린트 최적화 호출
<a name="invoking-blueprint-optimization"></a>

비동기 블루프린트 최적화 작업을 시작하여 각 블루프린트 필드에 대한 블루프린트의 지침과 결과 정확도를 개선합니다.

**구문**

```
aws bedrock-data-automation invoke-blueprint-optimization-async \
    --blueprint blueprintArn="arn:aws:bedrock:<region>:<account_id>:blueprint/<blueprint_id>",stage="DEVELOPMENT" \
    --samples '[
        {
            "assetS3Object": {
                "s3Uri": "s3://my-optimization-bucket/samples/document1.pdf"
            },
            "groundTruthS3Object": {
                "s3Uri": "s3://my-optimization-bucket/ground-truth/document1-expected.json"
            }
        }
    ]' \
    --output-configuration s3Object='{s3Uri="s3://my-optimization-bucket/results/optimization-output"}' \
    --data-automation-profile-arn "Amazon Resource Name (ARN):data-automation-profile/default"
```

### 블루프린트 최적화 상태 확인
<a name="checking-blueprint-optimization-status"></a>

블루프린트 최적화 작업의 진행 상황과 결과를 모니터링합니다.

**구문**

```
aws bedrock-data-automation get-blueprint-optimization-status \
    --invocation-arn "arn:aws:bedrock:<region>:<account_id>:blueprint-optimization-invocation/opt-12345abcdef"
```

이 명령을 사용하여 최적화 작업 상태를 추적합니다. 응답에는 현재 상태(생성됨, InProgress, 성공, ServiceError 또는 ClientError)와 완료되면 출력 구성 세부 정보가 포함됩니다.

### 블루프린트 단계 복사
<a name="copying-blueprint-stages"></a>

한 단계에서 다른 단계로 블루프린트 복사

**구문**

```
aws bedrock-data-automation copy-blueprint-stage \
    --blueprint-arn "arn:aws:bedrock:<region>:<account_id>:blueprint/<blueprint_id>" \
    --source-stage "DEVELOPMENT" \
    --target-stage "LIVE"
```

**주의:**이 명령은 소스 단계에서 대상 단계로 전체 블루프린트 구성을 복사하여 대상 단계의 기존 구성을 덮어씁니다.

**중요:** 프로덕션(라이브) 단계로 복사하기 전에 소스 단계에서 블루프린트를 철저히 테스트해야 합니다. 이 작업은 쉽게 실행 취소할 수 없습니다.

# CLI를 통한 처리
<a name="bda-document-processing-cli"></a>

BDA로 문서를 처리하기 전에 먼저 S3 버킷에 문서를 업로드해야 합니다.

**구문**

```
aws s3 cp <source> <target> [--options]
```

예제:

```
aws s3 cp /local/path/document.pdf s3://my-bda-bucket/input/document.pdf
```

------
#### [ Async ]

**기본 처리 명령 구조**

`invoke-data-automation-async` 명령을 사용하여 파일을 처리합니다.

```
aws bedrock-data-automation-runtime invoke-data-automation-async \
        --input-configuration '{
            "s3Uri": "s3://amzn-s3-demo-bucket/sample-images/sample-image.jpg"
        }' \
        --output-configuration '{
            "s3Uri": "s3://amzn-s3-demo-bucket/output/"
        }' \
        --data-automation-configuration '{
            "dataAutomationProjectArn": "Amazon Resource Name (ARN)",
            "stage": "LIVE"
        }' \
        --data-automation-profile-arn "Amazon Resource Name (ARN)"
```

**고급 처리 명령 구조**

**시간 세그먼트를 사용한 비디오 처리**

비디오 파일의 경우 처리할 시간 세그먼트를 지정할 수 있습니다.

```
aws bedrock-data-automation-runtime invoke-data-automation-async \
        --input-configuration '{
            "s3Uri": "s3://my-bucket/video.mp4",
            "assetProcessingConfiguration": {
                "video": {
                    "segmentConfiguration": {
                        "timestampSegment": {
                            "startTimeMillis": 0,
                            "endTimeMillis": 300000
                        }
                    }
                }
            }
        }' \
        --output-configuration '{
            "s3Uri": "s3://my-bucket/output/"
        }' \
        --data-automation-configuration '{
            "dataAutomationProjectArn": "Amazon Resource Name (ARN)",
            "stage": "LIVE"
        }' \
        --data-automation-profile-arn "Amazon Resource Name (ARN)"
```

**사용자 지정 블루프린트 사용**

명령에서 직접 사용자 지정 블루프린트를 지정할 수 있습니다.

```
aws bedrock-data-automation-runtime invoke-data-automation-async \
        --input-configuration '{
            "s3Uri": "s3://my-bucket/document.pdf"
        }' \
        --output-configuration '{
            "s3Uri": "s3://my-bucket/output/"
        }' \
        --blueprints '[
            {
                "blueprintArn": "Amazon Resource Name (ARN)",
                "version": "1",
                "stage": "LIVE"
            }
        ]' \
        --data-automation-profile-arn "Amazon Resource Name (ARN)"
```

**암호화 구성 추가**

보안 강화를 위해 암호화 구성을 추가할 수 있습니다.

```
aws bedrock-data-automation-runtime invoke-data-automation-async \
        --input-configuration '{
            "s3Uri": "s3://my-bucket/document.pdf"
        }' \
        --output-configuration '{
            "s3Uri": "s3://my-bucket/output/"
        }' \
        --data-automation-configuration '{
            "dataAutomationProjectArn": "Amazon Resource Name (ARN)",
            "stage": "LIVE"
        }' \
        --encryption-configuration '{
            "kmsKeyId": "Amazon Resource Name (ARN)",
            "kmsEncryptionContext": {
                "Department": "Finance",
                "Project": "DocumentProcessing"
            }
        }' \
        --data-automation-profile-arn "Amazon Resource Name (ARN)"
```

**이벤트 알림**

처리 완료를 위해 EventBridge 알림 활성화:

```
aws bedrock-data-automation-runtime invoke-data-automation-async \
        --input-configuration '{
            "s3Uri": "s3://my-bucket/document.pdf"
        }' \
        --output-configuration '{
            "s3Uri": "s3://my-bucket/output/"
        }' \
        --data-automation-configuration '{
            "dataAutomationProjectArn": "Amazon Resource Name (ARN)",
            "stage": "LIVE"
        }' \
        --notification-configuration '{
            "eventBridgeConfiguration": {
                "eventBridgeEnabled": true
            }
        }' \
        --data-automation-profile-arn "Amazon Resource Name (ARN)"
```

**처리 상태 확인**

처리 작업의 상태를 확인하려면 `get-data-automation-status` 명령을 사용합니다.

```
aws bedrock-data-automation-runtime get-data-automation-status \
        --invocation-arn "Amazon Resource Name (ARN)"
```

응답에는 현재 상태가 포함됩니다.

```
{
        "status": "COMPLETED",
        "creationTime": "2025-07-24T12:34:56.789Z",
        "lastModifiedTime": "2025-07-24T12:45:12.345Z",
        "outputLocation": "s3://my-bucket/output/abcd1234/"
        }
```

**처리 결과 검색**

**S3에서 출력 파일 찾기**

S3 버킷의 출력 파일 나열:

```
aws s3 ls s3://amzn-s3-demo-bucket/output/
```

결과를 로컬 시스템에 다운로드하려면 다음을 수행합니다.

```
aws s3 cp s3://amzn-s3-demo-bucket/output/ ~/Downloads/bda-results/ --recursive
```

**출력 구조 이해**

출력에는 일반적으로 다음이 포함됩니다.
+ `standard-output.json`: 표준 추출 결과 포함
+ `custom-output.json`: 사용자 지정 블루프린트의 결과 포함
+ `metadata.json`: 처리 메타데이터 및 신뢰도 점수 포함

**공통 응답 필드**

표준 출력에는 일반적으로 다음이 포함됩니다.
+ `extractedData`: 추출된 주요 정보
+ `confidence`: 추출된 각 필드의 신뢰도 점수
+ `metadata`: 타임스탬프 및 모델 세부 정보를 포함한 처리 정보
+ `boundingBoxes`: 감지된 요소의 위치 정보(활성화된 경우)

**오류 처리 및 문제 해결**

일반적인 오류 시나리오 및 해결 방법:
+ **잘못된 S3 URI**: S3 버킷이 존재하고 적절한 권한이 있는지 확인합니다.
+ **data-automation-profile-arn 누락**:이 파라미터는 모든 처리 요청에 필요합니다.
+ **프로젝트를 찾을 수 없음**: 프로젝트 ARN이 올바르고 프로젝트가 존재하는지 확인합니다.
+ **지원되지 않는 파일 형식**: 파일 형식이 BDA에서 지원되는지 확인합니다.

**처리 작업에 태그 추가**

태그를 추가하여 처리 작업을 구성하고 추적할 수 있습니다.

```
aws bedrock-data-automation-runtime invoke-data-automation-async \
        --input-configuration '{
            "s3Uri": "s3://my-bucket/document.pdf"
        }' \
        --output-configuration '{
            "s3Uri": "s3://my-bucket/output/"
        }' \
        --data-automation-configuration '{
            "dataAutomationProjectArn": "Amazon Resource Name (ARN)",
            "stage": "LIVE"
        }' \
        --tags '[
            {
                "key": "Department",
                "value": "Finance"
            },
            {
                "key": "Project",
                "value": "InvoiceProcessing"
            }
        ]' \
        --data-automation-profile-arn "Amazon Resource Name (ARN)"
```

------
#### [ Sync ]

**기본 처리 명령 구조**

`invoke-data-automation` 명령을 사용하여 파일을 처리합니다.

```
        aws bedrock-data-automation-runtime invoke-data-automation \
        --input-configuration '{
            "s3Uri": "s3://amzn-s3-demo-bucket/sample-images/sample-image.jpg"
        }' \
        --data-automation-configuration '{
            "dataAutomationProjectArn": "Amazon Resource Name (ARN)",
            "stage": "LIVE"
        }' \
        --data-automation-profile-arn "Amazon Resource Name (ARN)"
        --region "aws-region"
```

**고급 처리 명령 구조**

S3 버킷으로 출력

```
        aws bedrock-data-automation-runtime invoke-data-automation \
        --input-configuration '{
            "s3Uri": "s3://amzn-s3-demo-bucket/sample-images/sample-image.jpg"
        }' \
        --output-configuration '{"s3Uri": "s3://amzn-s3-demo-bucket/output/" }' \
        --data-automation-configuration '{
            "dataAutomationProjectArn": "Amazon Resource Name (ARN)",
            "stage": "LIVE"
        }' \
        --data-automation-profile-arn "Amazon Resource Name (ARN)"
        --region "aws-region"   //document only
```

바이트 입력 사용

```
        aws bedrock-data-automation-runtime invoke-data-automation \
        --input-configuration '{
            "bytes": #blob input
        }' \
        --output-configuration '{"s3Uri": "s3://amzn-s3-demo-bucket/output/" }' \
        --data-automation-configuration '{
            "dataAutomationProjectArn": "Amazon Resource Name (ARN)",
            "stage": "LIVE"
        }' \
        --data-automation-profile-arn "Amazon Resource Name (ARN)"
        --region "aws-region"
```

**참고**  
**바이트**  
base64로 인코딩된 문서 바이트의 BLOB입니다. 바이트 BLOB에 제공되는 문서의 최대 크기는 50MB입니다. 유형은 Base64-encoded 바이너리 데이터 객체여야 합니다.

**사용자 지정 블루프린트 사용(이미지에만 해당)**

```
        aws bedrock-data-automation-runtime invoke-data-automation \
        --input-configuration '{
            "s3Uri": "s3://amzn-s3-demo-bucket/sample-images/sample-image.jpg"
        }' \
        --blueprints '[{"blueprintArn": "Amazon Resource Name (ARN)", "version": "1", "stage": "LIVE" } ]' \
        --data-automation-profile-arn "Amazon Resource Name (ARN)"
        --region "aws-region"
```

------

# 사용 사례 처리
<a name="bda-document-processing-examples"></a>

Amazon Bedrock Data Automation을 사용하면 명령줄 인터페이스(CLI)를 통해 문서, 이미지, 오디오 및 비디오를 처리할 수 있습니다. 각 형식에 대해 워크플로는 프로젝트 생성, 분석 간접 호출, 결과 검색으로 구성됩니다.

원하는 방법의 탭을 선택한 후 다음 단계를 따릅니다.

------
#### [ Documents ]

**W2에서 데이터 추출**

![\[샘플 W2 양식에는 추출할 레이아웃과 데이터 필드를 보여주는 표준 필드가 있습니다.\]](http://docs.aws.amazon.com/ko_kr/bedrock/latest/userguide/images/bda/W2.png)


W2 양식을 처리할 때의 예제 스키마는 다음과 같습니다.

```
{
  "class": "W2TaxForm",
  "description": "Simple schema for extracting key information from W2 tax forms",
  "properties": {
    "employerName": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The employer's company name"
    },
    "employeeSSN": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The employee's Social Security Number (SSN)"
    },
    "employeeName": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The employee's full name"
    },
    "wagesAndTips": {
      "type": "number",
      "inferenceType": "explicit",
      "instruction": "Wages, tips, other compensation (Box 1)"
    },
    "federalIncomeTaxWithheld": {
      "type": "number",
      "inferenceType": "explicit",
      "instruction": "Federal income tax withheld (Box 2)"
    },
    "taxYear": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The tax year for this W2 form"
    }
  }
}
```

W2 처리를 간접적으로 호출하는 명령은 다음과 유사합니다.

```
aws bedrock-data-automation-runtime invoke-data-automation-async \
  --input-configuration '{
    "s3Uri": "s3://w2-processing-bucket-301678011486/input/W2.png"
  }' \
  --output-configuration '{
    "s3Uri": "s3://w2-processing-bucket-301678011486/output/"
  }' \
  --data-automation-configuration '{
    "dataAutomationProjectArn": "Amazon Resource Name (ARN)",
    "stage": "LIVE"
  }' \
  --data-automation-profile-arn "Amazon Resource Name (ARN):data-automation-profile/default"
```

예상 출력의 예는 다음과 같습니다.

```
{
  "documentType": "W2TaxForm",
  "extractedData": {
    "employerName": "The Big Company",
    "employeeSSN": "123-45-6789",
    "employeeName": "Jane Doe",
    "wagesAndTips": 48500.00,
    "federalIncomeTaxWithheld": 6835.00,
    "taxYear": "2014"
  },
  "confidence": {
    "employerName": 0.99,
    "employeeSSN": 0.97,
    "employeeName": 0.99,
    "wagesAndTips": 0.98,
    "federalIncomeTaxWithheld": 0.97,
    "taxYear": 0.99
  },
  "metadata": {
    "processingTimestamp": "2025-07-23T23:15:30Z",
    "documentId": "w2-12345",
    "modelId": "amazon.titan-document-v1",
    "pageCount": 1
  }
}
```

------
#### [ Images ]

**여행 광고 예제**

![\[사용자가 광고에서 정보를 추출하는 방법을 보여주는 샘플 이미지입니다.\]](http://docs.aws.amazon.com/ko_kr/bedrock/latest/userguide/images/bda/TravelAdvertisement.jpg)


여행 광고의 예제 스키마는 다음과 같습니다.

```
{
  "class": "TravelAdvertisement",
  "description": "Schema for extracting information from travel advertisement images",
  "properties": {
    "destination": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The name of the travel destination being advertised"
    },
    "tagline": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The main promotional text or tagline in the advertisement"
    },
    "landscapeType": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The type of landscape shown (e.g., mountains, beach, forest, etc.)"
    },
    "waterFeatures": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "Description of any water features visible in the image (ocean, lake, river, etc.)"
    },
    "dominantColors": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The dominant colors present in the image"
    },
    "advertisementType": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The type of travel advertisement (e.g., destination promotion, tour package, etc.)"
    }
  }
}
```

여행 광고 처리를 간접적으로 호출하는 명령은 다음과 유사합니다.

```
aws bedrock-data-automation-runtime invoke-data-automation-async \
  --input-configuration '{
    "s3Uri": "s3://travel-ads-bucket-301678011486/input/TravelAdvertisement.jpg"
  }' \
  --output-configuration '{
    "s3Uri": "s3://travel-ads-bucket-301678011486/output/"
  }' \
  --data-automation-configuration '{
    "dataAutomationProjectArn": "Amazon Resource Name (ARN)",
    "stage": "LIVE"
  }' \
  --data-automation-profile-arn "Amazon Resource Name (ARN):data-automation-profile/default"
```

예상 출력의 예는 다음과 같습니다.

```
{
  "documentType": "TravelAdvertisement",
  "extractedData": {
    "destination": "Kauai",
    "tagline": "Travel to KAUAI",
    "landscapeType": "Coastal mountains with steep cliffs and valleys",
    "waterFeatures": "Turquoise ocean with white surf along the coastline",
    "dominantColors": "Green, blue, turquoise, brown, white",
    "advertisementType": "Destination promotion"
  },
  "confidence": {
    "destination": 0.98,
    "tagline": 0.99,
    "landscapeType": 0.95,
    "waterFeatures": 0.97,
    "dominantColors": 0.96,
    "advertisementType": 0.92
  },
  "metadata": {
    "processingTimestamp": "2025-07-23T23:45:30Z",
    "documentId": "travel-ad-12345",
    "modelId": "amazon.titan-image-v1",
    "imageWidth": 1920,
    "imageHeight": 1080
  }
}
```

------
#### [ Audio ]

**전화 통화 트랜스크립션**

전화 통화에 대한 예제 스키마는 다음과 같습니다.

```
{
  "class": "AudioRecording",
  "description": "Schema for extracting information from AWS customer call recordings",
  "properties": {
    "callType": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The type of call (e.g., technical support, account management, consultation)"
    },
    "participants": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The number and roles of participants in the call"
    },
    "mainTopics": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The main topics or AWS services discussed during the call"
    },
    "customerIssues": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "Any customer issues or pain points mentioned during the call"
    },
    "actionItems": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "Action items or next steps agreed upon during the call"
    },
    "callDuration": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The duration of the call"
    },
    "callSummary": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "A brief summary of the entire call"
    }
  }
}
```

전화 통화 처리를 간접적으로 호출하는 명령은 다음과 유사합니다.

```
aws bedrock-data-automation-runtime invoke-data-automation-async \
  --input-configuration '{
    "s3Uri": "s3://audio-analysis-bucket-301678011486/input/AWS_TCA-Call-Recording-2.wav"
  }' \
  --output-configuration '{
    "s3Uri": "s3://audio-analysis-bucket-301678011486/output/"
  }' \
  --data-automation-configuration '{
    "dataAutomationProjectArn": "Amazon Resource Name (ARN)",
    "stage": "LIVE"
  }' \
  --data-automation-profile-arn "Amazon Resource Name (ARN):data-automation-profile/default"
```

예상 출력의 예는 다음과 같습니다.

```
{
  "documentType": "AudioRecording",
  "extractedData": {
    "callType": "Technical consultation",
    "participants": "3 participants: AWS Solutions Architect, AWS Technical Account Manager, and Customer IT Director",
    "mainTopics": "AWS Bedrock implementation, data processing pipelines, model fine-tuning, and cost optimization",
    "customerIssues": "Integration challenges with existing ML infrastructure, concerns about latency for real-time processing, questions about data security compliance",
    "actionItems": [
      "AWS team to provide documentation on Bedrock data processing best practices",
      "Customer to share their current ML architecture diagrams",
      "Schedule follow-up meeting to review implementation plan",
      "AWS to provide cost estimation for proposed solution"
    ],
    "callDuration": "45 minutes and 23 seconds",
    "callSummary": "Technical consultation call between AWS team and customer regarding implementation of AWS Bedrock for their machine learning workloads. Discussion covered integration approaches, performance optimization, security considerations, and next steps for implementation planning."
  },
  "confidence": {
    "callType": 0.94,
    "participants": 0.89,
    "mainTopics": 0.92,
    "customerIssues": 0.87,
    "actionItems": 0.85,
    "callDuration": 0.99,
    "callSummary": 0.93
  },
  "metadata": {
    "processingTimestamp": "2025-07-24T00:30:45Z",
    "documentId": "audio-12345",
    "modelId": "amazon.titan-audio-v1",
    "audioDuration": "00:45:23",
    "audioFormat": "WAV",
    "sampleRate": "44.1 kHz"
  },
  "transcript": {
    "segments": [
      {
        "startTime": "00:00:03",
        "endTime": "00:00:10",
        "speaker": "Speaker 1",
        "text": "Hello everyone, thank you for joining today's call about implementing AWS Bedrock for your machine learning workloads."
      },
      {
        "startTime": "00:00:12",
        "endTime": "00:00:20",
        "speaker": "Speaker 2",
        "text": "Thanks for having us. We're really interested in understanding how Bedrock can help us streamline our document processing pipeline."
      },
      {
        "startTime": "00:00:22",
        "endTime": "00:00:35",
        "speaker": "Speaker 3",
        "text": "Yes, and specifically we'd like to discuss integration with our existing systems and any potential latency concerns for real-time processing requirements."
      }
      // Additional transcript segments would continue here
    ]
  }
}
```

------
#### [ Video ]

**비디오 처리**

비디오에 대한 예제 스키마는 다음과 같습니다.

```
{
  "class": "VideoContent",
  "description": "Schema for extracting information from video content",
  "properties": {
    "title": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The title or name of the video content"
    },
    "contentType": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The type of content (e.g., tutorial, competition, documentary, advertisement)"
    },
    "mainSubject": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The main subject or focus of the video"
    },
    "keyPersons": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "Key people appearing in the video (hosts, participants, etc.)"
    },
    "keyScenes": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "Description of important scenes or segments in the video"
    },
    "audioElements": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "Description of notable audio elements (music, narration, dialogue)"
    },
    "summary": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "A brief summary of the video content"
    }
  }
}
```

비디오 처리를 간접적으로 호출하는 명령은 다음과 유사합니다.

```
aws bedrock-data-automation-runtime invoke-data-automation-async \
  --input-configuration '{
    "s3Uri": "s3://video-analysis-bucket-301678011486/input/MakingTheCut.mp4",
    "assetProcessingConfiguration": {
      "video": {
        "segmentConfiguration": {
          "timestampSegment": {
            "startTimeMillis": 0,
            "endTimeMillis": 300000
          }
        }
      }
    }
  }' \
  --output-configuration '{
    "s3Uri": "s3://video-analysis-bucket-301678011486/output/"
  }' \
  --data-automation-configuration '{
    "dataAutomationProjectArn": "Amazon Resource Name (ARN)",
    "stage": "LIVE"
  }' \
  --data-automation-profile-arn "Amazon Resource Name (ARN):data-automation-profile/default"
```

예상 출력의 예는 다음과 같습니다.

```
{
  "documentType": "VideoContent",
  "extractedData": {
    "title": "Making the Cut",
    "contentType": "Fashion design competition",
    "mainSubject": "Fashion designers competing to create the best clothing designs",
    "keyPersons": "Heidi Klum, Tim Gunn, and various fashion designer contestants",
    "keyScenes": [
      "Introduction of the competition and contestants",
      "Design challenge announcement",
      "Designers working in their studios",
      "Runway presentation of designs",
      "Judges' critique and elimination decision"
    ],
    "audioElements": "Background music, host narration, contestant interviews, and design feedback discussions",
    "summary": "An episode of 'Making the Cut' fashion competition where designers compete in a challenge to create innovative designs. The episode includes the challenge announcement, design process, runway presentation, and judging."
  },
  "confidence": {
    "title": 0.99,
    "contentType": 0.95,
    "mainSubject": 0.92,
    "keyPersons": 0.88,
    "keyScenes": 0.90,
    "audioElements": 0.87,
    "summary": 0.94
  },
  "metadata": {
    "processingTimestamp": "2025-07-24T00:15:30Z",
    "documentId": "video-12345",
    "modelId": "amazon.titan-video-v1",
    "videoDuration": "00:45:23",
    "analyzedSegment": "00:00:00 - 00:05:00",
    "resolution": "1920x1080"
  },
  "transcript": {
    "segments": [
      {
        "startTime": "00:00:05",
        "endTime": "00:00:12",
        "speaker": "Heidi Klum",
        "text": "Welcome to Making the Cut, where we're searching for the next great global fashion brand."
      },
      {
        "startTime": "00:00:15",
        "endTime": "00:00:25",
        "speaker": "Tim Gunn",
        "text": "Designers, for your first challenge, you'll need to create a look that represents your brand and can be sold worldwide."
      }
      // Additional transcript segments would continue here
    ]
  }
}
```

------