

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Amazon Bedrock Data Automation CLI の使用
<a name="bda-cli-guide"></a>

 Amazon Bedrock データ自動化 (BDA) 機能は、データを処理するための合理化された CLI ワークフローを提供します。すべてのモダリティにおいて、このワークフローは、プロジェクトの作成、カスタム出力用のブループリントの作成、ドキュメントの処理という 3 つの主要なステップで構成されます。このガイドでは、BDA を使用するための主要な CLI コマンドについて説明します。

## 最初の Data Automation プロジェクトを作成する
<a name="create-data-automation-project-cli"></a>

BDA の使用を開始するには、まず `create-data-automation-project` コマンドを使用してプロジェクトを作成します。

処理の対象となる次のサンプルパスポートについて考えてみましょう。

![\[alt text not found\]](http://docs.aws.amazon.com/ja_jp/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 のパラメータ**  

| [Parameter] (パラメータ) | 必須 | デフォルト | [Description] (説明) | 
| --- | --- | --- | --- | 
| --project-name | はい | 該当なし | Data Automation プロジェクトの名前 | 
| --project-type | いいえ | プロジェクトのタイプは、使用できるランタイム処理 API を定義します。 ASYNCプロジェクトは invoke-bedrock-data-automation-async API でのみ使用できますが、 SYNC プロジェクトは invoke-bedrock-data-automation API でのみ使用できます。 | 
| --project-stage | いいえ | LIVE | プロジェクトのステージ (DEVELOPMENT または 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 バケットにアップロードする必要があります。Sync 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>

このガイドでは、AWS Command Line Interface (CLI) for Amazon BedrockData Automation (BDA) を通じて利用できる設計図オペレーションについて説明します。

## ブループリントの作成
<a name="create-blueprints-cli"></a>

ブループリントは、ドキュメント、画像、音声、または動画のファイルから抽出するデータの構造とプロパティを定義します。新しいブループリントを定義するには、create-blueprint コマンドを使用します。

以下のコマンドは、パスポート画像からデータを抽出するための新しいブループリントを作成します。

**[Syntax]** (構文)

```
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 のパラメータ**  

| [Parameter] (パラメータ) | 必須 | デフォルト | [Description] (説明) | 
| --- | --- | --- | --- | 
| --blueprint-name | はい | 該当なし | ブループリントの名前 | 
| --type | はい | 該当なし | コンテンツタイプ (画像、ドキュメント、音声、動画) | 
| --blueprint-stage | 不可 | LIVE | ブループリントのステージ (開発環境または本番環境) | 
| --schema | はい | 該当なし | ブループリントの構造を定義する JSON スキーマ | 
| --client-token | 不可 | 自動生成 | リクエストのべき等性を確保するための一意の識別子 | 

## ブループリント設定の表示
<a name="view-blueprint-cli"></a>

**すべてのブループリントを一覧表示する**

アカウントに関連付けられているすべてのブループリントのリストを取得するには、list-blueprints コマンドを使用します。

**[Syntax]** (構文)

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

**ブループリントの詳細を表示する**

スキーマや構成など、特定のブループリントに関する詳細情報を表示するには、get-blueprint コマンドを使用します。

**[Syntax]** (構文)

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

**特定のバージョンを検査する**

バージョン管理されたブループリントを使用する場合に、特定のバージョンを表示するには、get-blueprint コマンドで --blueprint-version オプションを使用します。

**[Syntax]** (構文)

```
      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 コマンドを使用します。

**[Syntax]** (構文)

```
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 オプションを使用します。

**[Syntax]** (構文)

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

**ブループリントのバージョニング**

大幅な変更を加える前に、create-blueprint-version コマンドを使用してブループリントの新しいバージョンを作成し、現在の状態を保存します。

**[Syntax]** (構文)

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

## ブループリントタグの管理
<a name="tag-management-cli"></a>

タグを使用すると、ブループリントを整理および分類して、管理を簡素化するのに役立ちます。

**タグを追加する**

タグを追加して、メタデータをブループリントに適用します。

**[Syntax]** (構文)

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

**タグを削除する**

untag-resource コマンドを使用して、ブループリントから特定のタグを削除します。

**[Syntax]** (構文)

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

**タグを表示する**

ブループリントに関連付けられているすべてのタグを一覧表示するには、list-tags-for-resource コマンドを使用します。

**[Syntax]** (構文)

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

## ブループリントの削除
<a name="delete-blueprint-cli"></a>

**ブループリント全体を削除する**

ブループリントとブループリントのすべてのバージョンを完全に削除するには、delete-blueprint コマンドを使用します。

**[Syntax]** (構文)

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

**注:** このコマンドはブループリントを完全に削除するため、復元することはできません。

**重要:** 現在いずれかのプロジェクトで使用されているブループリントは、削除することはできません。削除する前に、プロジェクトのカスタム出力設定でブループリントが参照されていないことを確認する必要があります。

## 設計図の最適化
<a name="blueprint-optimization-cli"></a>

### 設計図の最適化の呼び出し
<a name="invoking-blueprint-optimization"></a>

非同期ブループリント最適化ジョブを開始して、各ブループリントフィールドのブループリントの指示と結果の精度を向上させます。

**[Syntax]** (構文)

```
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>

ブループリント最適化ジョブの進行状況と結果をモニタリングします。

**[Syntax]** (構文)

```
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>

あるステージから別のステージにブループリントをコピーする

**[Syntax]** (構文)

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

**注意:** このコマンドは、ブループリント設定全体をソースステージからターゲットステージにコピーし、ターゲットステージの既存の設定を上書きします。

**重要:** 本番環境 (LIVE) ステージにコピーする前に、ブループリントがソースステージで徹底的にテストされていることを確認します。この操作は簡単に元に戻すことができません。

# CLI を介した処理
<a name="bda-document-processing-cli"></a>

BDA でドキュメントを処理する前に、まずドキュメントを S3 バケットにアップロードする必要があります。

**[Syntax]** (構文)

```
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 で提供されるドキュメントの最大サイズは 50 MB です。タイプは 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/ja_jp/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/ja_jp/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
    ]
  }
}
```

------