

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# Menggunakan CLI Otomasi Amazon Bedrock Data
<a name="bda-cli-guide"></a>

Fitur Otomasi Amazon Bedrock Data (BDA) menyediakan alur kerja CLI yang efisien untuk memproses data Anda. Untuk semua modalitas, alur kerja ini terdiri dari tiga langkah utama: membuat proyek, membuat Blueprints untuk output kustom, dan memproses dokumen. Panduan ini memandu Anda melalui perintah CLI kunci untuk bekerja dengan BDA. 

## Buat proyek Otomasi Data pertama Anda
<a name="create-data-automation-project-cli"></a>

Untuk mulai bekerja dengan BDA, pertama buat proyek menggunakan `create-data-automation-project` perintah.

Pertimbangkan contoh paspor ini yang akan kami proses:

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


Saat membuat proyek, Anda harus menentukan pengaturan konfigurasi untuk jenis file yang ingin Anda proses. Perintah berikut merupakan contoh kerja minimal untuk membuat proyek pemrosesan gambar:

```
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"
            }
        }
    }'
```

Perintah memvalidasi konfigurasi input dan membuat proyek baru dengan ARN yang unik. Tanggapan akan mencakup proyek ARN dan tahap:

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

Jika proyek dibuat tanpa parameter, pengaturan default akan berlaku. Misalnya, saat memproses gambar, ringkasan gambar dan deteksi teks akan diaktifkan secara default.

## Referensi parameter lengkap
<a name="create-project-parameters"></a>

Tabel berikut menunjukkan semua parameter yang tersedia untuk `create-data-automation-project` perintah:


**Parameter untuk create-data-automation-project**  

| Parameter | Diperlukan | Default | Deskripsi | 
| --- | --- | --- | --- | 
| --project-name | Ya | N/A | Nama untuk proyek Otomasi Data | 
| --project-type | Tidak | Jenis proyek menentukan API pemrosesan runtime mana yang dapat digunakan dengannya. ASYNCproyek hanya dapat digunakan dengan invoke-bedrock-data-automation-async API, sedangkan SYNC proyek hanya dapat digunakan dengan invoke-bedrock-data-automation API. | 
| --project-stage | Tidak | LANGSUNG | Tahap untuk proyek (PENGEMBANGAN atau LANGSUNG) | 
| --standard-output-configuration | Ya | N/A | Konfigurasi JSON untuk pemrosesan keluaran standar | 
| --custom-output-configuration | Tidak | N/A | Konfigurasi JSON untuk pemrosesan keluaran kustom | 
| --encryption-configuration | Tidak | N/A | Pengaturan enkripsi untuk proyek | 
| --client-token | Tidak | Dihasilkan secara otomatis | Pengidentifikasi unik untuk idempotensi permintaan | 

## Membuat Blueprint
<a name="create-blueprint-cli"></a>

Setelah membuat proyek, Anda dapat membuat Blueprint untuk menentukan struktur pemrosesan data Anda menggunakan perintah. `create-blueprint`

Berikut adalah contoh kerja minimal untuk membuat Blueprint yang disesuaikan dengan pemrosesan paspor:

```
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"
            }
        }
    }'
```

Perintah membuat Blueprint baru dengan skema yang ditentukan. Anda kemudian dapat menggunakan Blueprint ini saat memproses dokumen untuk mengekstrak data terstruktur sesuai dengan skema yang Anda tentukan.

## Menggunakan Blueprint
<a name="using-blueprint-cli"></a>

### Menambahkan Blueprint ke proyek
<a name="adding-blueprint-to-project"></a>

Untuk menambahkan Blueprint ke project Anda, gunakan perintah: `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"
            }
        ]
    }'
```

### Memverifikasi integrasi Blueprint
<a name="verifying-blueprint-integration"></a>

Anda dapat memverifikasi integrasi Blueprint menggunakan perintah: `get-data-automation-project`

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

### Mengelola beberapa Cetak Biru
<a name="managing-multiple-blueprints"></a>

Gunakan `list-blueprints` perintah untuk melihat semua Blueprints Anda:

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

## Memproses Dokumen Secara Asinkron
<a name="invoke-data-automation-cli"></a>

Sebelum memproses dokumen dengan BDA, Anda harus terlebih dahulu mengunggah dokumen Anda ke ember S3. Setelah Anda menyiapkan proyek, Anda dapat memproses dokumen menggunakan perintah: `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)"
```

Perintah mengembalikan ARN pemanggilan yang dapat Anda gunakan untuk memeriksa status pemrosesan:

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

## Periksa Status Pemrosesan
<a name="get-data-automation-status-cli"></a>

Untuk memeriksa status pekerjaan pemrosesan Anda, gunakan `get-data-automation-status` perintah:

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

Perintah mengembalikan status saat ini dari pekerjaan pemrosesan:

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

Nilai status yang mungkin meliputi:
+ `IN_PROGRESS`: Pekerjaan pemrosesan sedang berjalan.
+ `COMPLETED`: Pekerjaan pemrosesan telah berhasil diselesaikan.
+ `FAILED`: Pekerjaan pemrosesan telah gagal. Periksa respons untuk detail kesalahan.
+ `STOPPED`: Pekerjaan pemrosesan dihentikan secara manual.

## Ambil Hasil
<a name="retrieve-results-cli"></a>

Setelah pemrosesan selesai, Anda dapat membuat daftar file output di bucket S3 Anda:

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

Untuk mengunduh hasilnya ke mesin lokal Anda:

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

Outputnya mencakup data terstruktur berdasarkan konfigurasi proyek Anda dan Cetak Biru apa pun yang telah Anda terapkan.

## Memproses Dokumen Secara Sinkron
<a name="process-docs-sync"></a>

Sebelum memproses dokumen dengan BDA, Anda harus terlebih dahulu mengunggah dokumen Anda ke bucket S3. API sinkronisasi merusak input melalui bucket S3 atau byte gambar (yaitu memproses dokumen tanpa S3). Perintah mengembalikan data terstruktur berdasarkan konfigurasi proyek Anda dan Blueprints apa pun yang telah Anda terapkan:

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

## Memproses Gambar Secara Sinkron
<a name="process-images-sync"></a>

Perintah mengembalikan data terstruktur berdasarkan konfigurasi proyek Anda dan Blueprints apa pun yang telah Anda terapkan:

```
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 Operasi Cetak Biru
<a name="bda-blueprint-operations"></a>

Panduan ini mencakup operasi Blueprint yang tersedia melalui AWS Command Line Interface (CLI) untuk Otomasi Amazon Bedrock Data (BDA).

## Membuat Cetak Biru
<a name="create-blueprints-cli"></a>

Cetak biru menentukan struktur dan properti data yang ingin Anda ekstrak dari dokumen, gambar, audio, atau file video Anda. Gunakan perintah create-blueprint untuk menentukan Blueprint baru.

Perintah berikut membuat Blueprint baru yang disesuaikan untuk mengekstrak data dari gambar paspor.

**Sintaksis**

```
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"
          }
        }
      }'
```

## Referensi parameter lengkap
<a name="create-blueprint-parameters"></a>

Tabel berikut menunjukkan semua parameter yang tersedia untuk `create-blueprint` perintah:


**Parameter untuk create-blueprint**  

| Parameter | Diperlukan | Default | Deskripsi | 
| --- | --- | --- | --- | 
| --blueprint-name | Ya | N/A | Nama untuk Blueprint | 
| --type | Ya | N/A | Jenis konten (GAMBAR, DOKUMEN, AUDIO, VIDEO) | 
| --blueprint-stage | Tidak | LANGSUNG | Tahap untuk Cetak Biru (PENGEMBANGAN atau LANGSUNG) | 
| --schema | Ya | N/A | Skema JSON mendefinisikan struktur Blueprint | 
| --client-token | Tidak | Dihasilkan secara otomatis | Pengidentifikasi unik untuk idempotensi permintaan | 

## Melihat konfigurasi Blueprint
<a name="view-blueprint-cli"></a>

**Daftar semua Cetak Biru**

Gunakan perintah list-blueprints untuk mengambil daftar semua Blueprints yang terkait dengan akun Anda.

**Sintaksis**

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

**Lihat detail Blueprint**

Untuk melihat informasi rinci tentang Blueprint tertentu, termasuk skema dan konfigurasinya, gunakan perintah get-blueprint.

**Sintaksis**

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

**Periksa versi tertentu**

Saat bekerja dengan Blueprints berversi, gunakan perintah get-blueprint dengan opsi --blueprint-version untuk melihat versi tertentu.

**Sintaksis**

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

**Periksa tahap tertentu**

Untuk melihat Cetak Biru di tahap PENGEMBANGAN atau LANGSUNG, gunakan:

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

## Mengedit spesifikasi Blueprint
<a name="edit-blueprint-cli"></a>

**Perbarui pengaturan Blueprint**

Untuk memodifikasi skema atau properti Blueprint yang ada, gunakan perintah update-blueprint.

**Sintaksis**

```
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"
          }
        }
      }'
```

**Catatan:** Saat memperbarui Cetak Biru, Anda harus menyediakan skema lengkap, bahkan untuk bidang yang tidak Anda ubah.

**Promosikan untuk LIVE**

Untuk memindahkan Blueprint dari DEVELOPMENT ke tahap LIVE untuk produksi, gunakan perintah update-blueprint dengan opsi --blueprint-stage.

**Sintaksis**

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

**Versi cetak biru**

Buat versi baru Blueprint Anda untuk mempertahankan statusnya saat ini sebelum membuat perubahan signifikan menggunakan perintah. create-blueprint-version

**Sintaksis**

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

## Mengelola tag Blueprint
<a name="tag-management-cli"></a>

Tag membantu pengguna mengatur dan mengkategorikan Cetak Biru untuk pengelolaan yang disederhanakan.

**Tambahkan tag**

Terapkan metadata ke Blueprint Anda dengan menambahkan tag.

**Sintaksis**

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

**Hapus tag**

Hapus tag tertentu dari Blueprint Anda dengan perintah untag-resource.

**Sintaksis**

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

**Lihat tag**

Buat daftar semua tag yang terkait dengan Blueprint Anda menggunakan perintah. list-tags-for-resource

**Sintaksis**

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

## Menghapus Cetak Biru
<a name="delete-blueprint-cli"></a>

**Hapus seluruh Blueprint**

Gunakan perintah delete-blueprint untuk menghapus Blueprint dan semua versinya secara permanen.

**Sintaksis**

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

**Perhatian:** Perintah ini menghapus Blueprint secara permanen dan tidak dapat memulihkannya.

**Penting:** Anda tidak dapat menghapus Blueprint yang saat ini digunakan oleh proyek apa pun. Sebelum menghapus, pastikan Blueprint tidak direferensikan dalam konfigurasi keluaran kustom proyek apa pun.

## Pengoptimalan Cetak Biru
<a name="blueprint-optimization-cli"></a>

### Memohon Pengoptimalan Cetak Biru
<a name="invoking-blueprint-optimization"></a>

Mulai pekerjaan pengoptimalan cetak biru asinkron untuk meningkatkan instruksi cetak biru dari setiap bidang cetak biru Anda dan akurasi hasil.

**Sintaksis**

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

### Memeriksa Status Pengoptimalan Cetak Biru
<a name="checking-blueprint-optimization-status"></a>

Pantau kemajuan dan hasil pekerjaan optimasi cetak biru.

**Sintaksis**

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

Gunakan perintah ini untuk melacak status pekerjaan optimasi. Respons mencakup status saat ini (Dibuat, InProgress, Sukses ServiceError, atau ClientError) dan detail konfigurasi keluaran saat selesai.

### Menyalin Tahapan Cetak Biru
<a name="copying-blueprint-stages"></a>

Salin Blueprint dari satu tahap ke tahap lainnya

**Sintaksis**

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

**Perhatian:** Perintah ini menyalin seluruh konfigurasi Blueprint dari tahap sumber ke tahap target, menimpa konfigurasi yang ada di tahap target.

**Penting:** Pastikan Cetak Biru diuji secara menyeluruh di tahap sumber sebelum menyalin ke tahap produksi (LIVE). Operasi ini tidak dapat dibatalkan dengan mudah.

# Pemrosesan melalui CLI
<a name="bda-document-processing-cli"></a>

Sebelum memproses dokumen dengan BDA, Anda harus terlebih dahulu mengunggah dokumen Anda ke bucket S3:

**Sintaksis**

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

Contoh:

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

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

**Struktur perintah pemrosesan dasar**

Gunakan `invoke-data-automation-async` perintah untuk memproses file:

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

**Struktur perintah pemrosesan lanjutan**

**Pemrosesan video dengan segmen waktu**

Untuk file video, Anda dapat menentukan segmen waktu untuk diproses:

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

**Menggunakan cetak biru khusus**

Anda dapat menentukan cetak biru khusus secara langsung di perintah:

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

**Menambahkan konfigurasi enkripsi**

Untuk keamanan yang ditingkatkan, Anda dapat menambahkan konfigurasi enkripsi:

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

**Pemberitahuan acara**

Aktifkan EventBridge pemberitahuan untuk penyelesaian pemrosesan:

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

**Memeriksa status pemrosesan**

Gunakan `get-data-automation-status` perintah untuk memeriksa status pekerjaan pemrosesan Anda:

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

Tanggapan akan mencakup status saat ini:

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

**Ambil hasil pemrosesan**

**Menemukan file output di S3**

Buat daftar file output di bucket S3 Anda:

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

Unduh hasilnya ke mesin lokal Anda:

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

**Memahami struktur keluaran**

Output biasanya meliputi:
+ `standard-output.json`: Berisi hasil ekstraksi standar
+ `custom-output.json`: Berisi hasil dari cetak biru kustom
+ `metadata.json`: Berisi metadata pemrosesan dan skor kepercayaan

**Bidang respons umum**

Output standar biasanya meliputi:
+ `extractedData`: Informasi utama yang diekstraksi
+ `confidence`: Skor kepercayaan untuk setiap bidang yang diekstraksi
+ `metadata`: Memproses informasi termasuk stempel waktu dan detail model
+ `boundingBoxes`: Informasi lokasi untuk elemen yang terdeteksi (jika diaktifkan)

**Penanganan kesalahan dan pemecahan masalah**

Skenario dan solusi kesalahan umum:
+ **URI S3 tidak valid**: Pastikan bucket S3 Anda ada dan Anda memiliki izin yang tepat
+ **Hilang data-automation-profile-arn**: Parameter ini diperlukan untuk semua permintaan pemrosesan
+ **Proyek tidak ditemukan**: Verifikasi ARN proyek Anda benar dan proyek ada
+ **Format file yang tidak didukung**: Periksa apakah format file Anda didukung oleh BDA

**Menambahkan tag untuk memproses pekerjaan**

Anda dapat menambahkan tag untuk membantu mengatur dan melacak pekerjaan pemrosesan Anda:

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

**Struktur perintah pemrosesan dasar**

Gunakan `invoke-data-automation` perintah untuk memproses file:

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

**Struktur perintah pemrosesan lanjutan**

Output ke ember 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
```

Gunakan masukan byte

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

**catatan**  
**Byte**  
Gumpalan byte dokumen yang dikodekan base64. Ukuran maksimum dokumen yang disediakan dalam gumpalan byte adalah 50 MB. Tipe harus berupa objek data biner yang dikodekan Base64.

**Gunakan cetak biru khusus (hanya untuk gambar)**

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

------

# Memproses kasus penggunaan
<a name="bda-document-processing-examples"></a>

Amazon Bedrock Data Automation memungkinkan Anda memproses dokumen, gambar, audio, dan video. melalui antarmuka baris perintah (CLI). Untuk setiap modalitas, alur kerja terdiri dari membuat proyek, menjalankan analisis, dan mengambil hasilnya.

Pilih tab untuk metode pilihan Anda, lalu ikuti langkah-langkahnya:

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

**Mengekstrak data dari W2**

![\[Contoh formulir W2 dengan bidang standar, menunjukkan tata letak dan bidang data yang akan diekstraksi.\]](http://docs.aws.amazon.com/id_id/bedrock/latest/userguide/images/bda/W2.png)


Saat memproses formulir W2, skema contoh adalah sebagai berikut:

```
{
  "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"
    }
  }
}
```

Perintah untuk memanggil pemrosesan W2 akan serupa dengan yang berikut:

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

Contoh output yang diharapkan adalah:

```
{
  "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 ]

**Contoh iklan perjalanan**

![\[Contoh gambar, menunjukkan bagaimana pengguna dapat mengekstrak informasi dari iklan.\]](http://docs.aws.amazon.com/id_id/bedrock/latest/userguide/images/bda/TravelAdvertisement.jpg)


Contoh skema untuk iklan perjalanan adalah sebagai berikut:

```
{
  "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.)"
    }
  }
}
```

Perintah untuk meminta pemrosesan iklan perjalanan akan serupa dengan yang berikut:

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

Contoh output yang diharapkan adalah:

```
{
  "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 ]

**Mentranskripsikan panggilan telepon**

Contoh skema untuk panggilan telepon adalah sebagai berikut:

```
{
  "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"
    }
  }
}
```

Perintah untuk memanggil pemrosesan panggilan telepon akan serupa dengan yang berikut:

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

Contoh output yang diharapkan adalah:

```
{
  "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 ]

**Memproses video**

Contoh skema untuk video adalah sebagai berikut:

```
{
  "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"
    }
  }
}
```

Perintah untuk memanggil pemrosesan video akan serupa dengan yang berikut:

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

Contoh output yang diharapkan adalah:

```
{
  "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
    ]
  }
}
```

------