

# 建立和管理登錄檔
<a name="registry-create-manage"></a>

**即將進行的命名空間遷移**  
 AWS 客服人員登錄檔目前在 bedrock-agentcore 命名空間下為公開預覽。從 2026 年 8 月 6 日開始，服務會移至代理程式登錄命名空間。如果您使用 AWS 代理程式登錄檔，則必須更新端點、IAM 政策、SDK 用戶端、CLI 指令碼和登錄檔資料。如需從公有預覽遷移的詳細資訊，請參閱 [綜合登錄遷移指南](registry-faq.md)。

## 建立登錄檔
<a name="registry-create"></a>

### 主控台
<a name="registry-create-console"></a>

1. 開啟 [Amazon Bedrock AgentCore 主控台](https://console.aws.amazon.com/bedrock-agentcore/home?region=us-east-1#)。

1. 在導覽窗格的**探索** 下，選擇**登錄**檔。

1. 在**登錄**檔區段中，選擇**建立登錄**檔。

1. 在**名稱** 中，輸入登錄檔的名稱。名稱必須以字母或數字開頭。有效字元為 a-z、A-Z、0-9、\_ （底線）、- （連字號）、. （點） 和 / （正斜線）。名稱最多可有 64 個字元。

1. （選用） 展開**其他詳細資訊**並輸入**描述** (1–4，096 個字元）。

1. （選用） 展開**搜尋 API 授權**，以設定消費者在搜尋登錄檔時授權的方式 （傳入授權）。選擇 ** AWS IAM** 以使用標準 AWS 登入資料，或選擇 **JSON Web 字符 (JWT)** 以使用您的公司身分提供者登入資料。如果您選擇 JWT，您可以使用 Cognito 快速建立，或提供探索 URL、對象、範圍、自訂宣告和用戶端來使用自己的 IdP。

1. 在**記錄核准** 下，選擇是否啟用**自動核准** 。當自動核准關閉時，策展者必須先檢閱和核准每個記錄，才能搜尋。

1. 選擇**建立登錄**檔。

登錄檔狀態開始為**建立**，並在佈建完成時轉換為**就緒**。

**注意**  
對於啟用 JWT 的登錄檔，至少需要一個 **JWT 授權組態**欄位：允許對象、允許用戶端、允許範圍或自訂宣告。如果您設定多個， AWS 客服人員登錄檔會驗證所有項目。

### AWS CLI
<a name="registry-create-cli"></a>

 **IAM 型登錄：**

```
aws bedrock-agentcore-control create-registry \
  --name "MyRegistry" \
  --description "Production registry" \
  --region us-east-1
```

 **以 JWT 為基礎的登錄檔：**

```
aws bedrock-agentcore-control create-registry \
  --name "MyOAuthRegistry" \
  --authorizer-type CUSTOM_JWT \
  --authorizer-configuration '{"customJWTAuthorizer": {"discoveryUrl": "https://cognito-idp.us-east-1.amazonaws.com/<poolId>/.well-known/openid-configuration", "allowedClients": ["<appClientId>"]}}' \
  --region us-east-1
```

### AWS 開發套件
<a name="registry-create-sdk"></a>

 **IAM 型登錄：**

```
import boto3

client = boto3.client('bedrock-agentcore-control')

response = client.create_registry(
    name='MyRegistry',
    description='Production registry'
)
print(response['registryArn'])
```

 **以 JWT 為基礎的登錄檔：**

```
import boto3

client = boto3.client('bedrock-agentcore-control')

response = client.create_registry(
    name='MyOAuthRegistry',
    authorizerType='CUSTOM_JWT',
    authorizerConfiguration={
        'customJWTAuthorizer': {
            'discoveryUrl': 'https://cognito-idp.us-east-1.amazonaws.com/<poolId>/.well-known/openid-configuration',
            'allowedClients': ['<appClientId>']
        }
    }
)
print(response['registryArn'])
```

## 列出登錄檔
<a name="registry-list"></a>

### 主控台
<a name="registry-list-console"></a>

1. 開啟 [Amazon Bedrock AgentCore 主控台](https://console.aws.amazon.com/bedrock-agentcore/home?region=us-east-1#)。

1. 在導覽窗格的**探索** 下，選擇**登錄**檔。

1. **註冊表**會以下列資料欄顯示您帳戶中的所有註冊：

   1.  **名稱** — 登錄檔名稱 （連結至詳細資訊頁面）。

   1.  **描述** — 如果提供，則為登錄檔描述。

   1.  **授權類型** — 傳入授權方法 (AWS\_IAM 或 CUSTOM\_JWT)。

   1.  **狀態** — 目前狀態 （建立、就緒、更新、刪除或失敗狀態）。

   1.  **ARN** — 登錄檔 Amazon Resource Name。

   1.  **已建立** — 建立時間戳記。

   1.  **上次更新** — 上次修改時間戳記。

1. 使用**尋找登錄檔**搜尋列依名稱篩選。

1. 使用分頁控制項瀏覽結果。

### AWS CLI
<a name="registry-list-cli"></a>

```
aws bedrock-agentcore-control list-registries \
  --region us-east-1
```

### AWS 開發套件
<a name="registry-list-sdk"></a>

```
import boto3

client = boto3.client('bedrock-agentcore-control')

response = client.list_registries()
for registry in response['registries']:
    print(f"{registry['name']} - {registry['status']} - {registry['registryArn']}")
```

## 檢視登錄檔詳細資訊
<a name="registry-view-details"></a>

### 主控台
<a name="registry-view-console"></a>

1. 開啟 [Amazon Bedrock AgentCore 主控台](https://console.aws.amazon.com/bedrock-agentcore/home?region=us-east-1#)。

1. 在導覽窗格的**探索** 下，選擇**登錄**檔。

1. 從註冊表選擇**註冊表**名稱。

1. 登錄檔詳細資訊頁面有兩個索引標籤：

   1.  **管理記錄** — 檢視和管理登錄檔記錄。

   1.  **搜尋記錄** — 在登錄檔中搜尋已核准的記錄。

1. **登錄檔詳細資訊**區段會顯示：名稱、狀態、描述、自動核准 （啟用或停用）、登錄檔 ARN、上次更新日期、建立日期。

1. **登錄檔記錄**區段會顯示狀態摘要計數器 （提交總數、待核准、已核准、已棄用、已拒絕） 和記錄表。

1. **搜尋 API 授權** （傳入授權） 區段顯示目前的授權類型。

### AWS CLI
<a name="registry-view-cli"></a>

```
aws bedrock-agentcore-control get-registry \
  --registry-id "<registryId>" \
  --region us-east-1
```

### AWS 開發套件
<a name="registry-view-sdk"></a>

```
import boto3

client = boto3.client('bedrock-agentcore-control')

response = client.get_registry(
    registryId='<registryId>'
)
print(f"Name: {response['name']}")
print(f"Status: {response['status']}")
print(f"ARN: {response['registryArn']}")
```

## 更新登錄檔
<a name="registry-update"></a>

### 主控台
<a name="registry-update-console"></a>

1. 開啟 [Amazon Bedrock AgentCore 主控台](https://console.aws.amazon.com/bedrock-agentcore/home?region=us-east-1#)。

1. 在導覽窗格的**探索** 下，選擇**登錄**檔。

1. 選取您要編輯之登錄檔旁的選項按鈕，然後選擇**編輯** 。或者，選擇登錄檔名稱，然後選擇**編輯**。

1. 在**編輯登錄**頁面上，更新下列任何項目：

   1.  **名稱** — 變更登錄檔名稱 （與建立相同的命名規則）。

   1.  **描述** — 在**其他詳細資訊** 下，更新或新增描述。

   1.  **記錄核准** — 開啟或關閉**自動核准**。變更只會影響更新後提交的記錄。

1. 選擇**儲存變更**。

**注意**  
將自動核准組態從 OFF 更新為 ON 只會影響變更後提交的記錄。已經「待核准」的現有記錄不受影響，但仍必須透過呼叫 UpdateRegistryRecordStatus API 來核准或拒絕。將組態從 ON 變更為 OFF 只會影響變更後發佈至「待核准」的記錄。

**注意**  
探索 URL （適用於 JWT 授權登錄檔） 無法在建立登錄檔之後變更。建立登錄檔後，無法變更傳入授權類型 (IAM 或 JWT)。

### AWS CLI
<a name="registry-update-cli"></a>

```
aws bedrock-agentcore-control update-registry \
  --registry-id "<registryId>" \
  --description '{"optionalValue": "Updated description"}' \
  --region us-east-1
```

### AWS 開發套件
<a name="registry-update-sdk"></a>

```
import boto3

client = boto3.client('bedrock-agentcore-control')

response = client.update_registry(
    registryId='<registryId>',
    description={'optionalValue': 'Updated description'}
)
print(f"Updated: {response['name']} - Status: {response['status']}")
```

## 刪除登錄檔
<a name="registry-delete"></a>

### 主控台
<a name="registry-delete-console"></a>

1. 開啟 [Amazon Bedrock AgentCore 主控台](https://console.aws.amazon.com/bedrock-agentcore/home?region=us-east-1#)。

1. 在導覽窗格的**探索** 下，選擇**登錄**檔。

1. 選取您要刪除之登錄檔旁的選項按鈕，然後選擇**刪除**。

1. 在確認對話方塊中，檢閱警告：您必須先刪除所有登錄檔記錄，然後再刪除登錄檔。

1. 在確認欄位中輸入**刪除**。

1. 選擇 **刪除**。

登錄檔狀態會變更為**刪除** 。成功橫幅會在刪除完成時確認。

### AWS CLI
<a name="registry-delete-cli"></a>

```
aws bedrock-agentcore-control delete-registry \
  --registry-id "<registryId>" \
  --region us-east-1
```

### AWS 開發套件
<a name="registry-delete-sdk"></a>

```
import boto3

client = boto3.client('bedrock-agentcore-control')

response = client.delete_registry(
    registryId='<registryId>'
)
print(f"Status: {response['status']}")  # DELETING
```