

• 2026 年 4 月 30 日之後將不再提供 AWS Systems Manager CloudWatch Dashboard。客戶可以繼續使用 Amazon CloudWatch 主控台來檢視、建立和管理其 Amazon CloudWatch 儀表板，就像現在一樣。如需詳細資訊，請參閱 [Amazon CloudWatch Dashboard 文件](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 設定 EventBridge 規則以建立 OpsItems
<a name="OpsCenter-automatically-create-OpsItems-2"></a>

Amazon EventBridge 收到事件後，它會根據預設規則建立新的 OpsItem。您可以建立規則或編輯現有的規則，以將 OpsCenter 設定為 EventBridge 事件的目標。如需有關如何建立事件規則的詳細資訊，請參閱《Amazon EventBridge 使用者指南》**中的[為 AWS 服務建立規則](https://docs.aws.amazon.com/eventbridge/latest/userguide/create-eventbridge-rule.html)。

**設定 EventBridge 規則以在 OpsCenter 中建立 OpsItems**

1. 前往 [https://console.aws.amazon.com/events/](https://console.aws.amazon.com/events/) 開啟 Amazon EventBridge 主控台。

1. 在導覽窗格中，選擇**規則**。

1. 在 **Rules** (規則) 頁面，針對 **Event bus** (事件匯流排)，選擇 **default** (預設值)。

1. 在**規則**中，選取名稱旁的核取方塊，以選擇規則。

1. 選取規則的名稱，開啟其詳細資訊頁面。在**規則詳細資訊**中，確認**狀態**已設定為**已啟用**。
**注意**  
如有必要，您可以使用頁面右上角的**編輯**來更新狀態。

1. 選擇 **Targets (目標)** 標籤。

1. 在 **Targets (目標)** 索引標籤上，選擇 **Edit (編輯)**。

1. 對於**目標類型**，請選取 **AWS 服務**。

1. 針對 **Select a target** (選取目標)，請選擇 **Systems Manager OpsItem**。

1. 對於許多目標類型，EventBridge 需要許可才能將事件傳送到目標。在這些情況下，EventBridge 可以建立執行規則所需的 AWS Identity and Access Management (IAM) 角色：
   + 若要自動建立 IAM 角色，請選擇**為此特定資源建立新角色**。
   + 若要使用您建立的 IAM 角色授予 EventBridge 許可，以在 OpsCenter 中建立 OpsItems，請選擇 **Use existing role** (使用現有的角色)。

1. 在**其他設定**的**設定目標輸入**中，選擇**輸入轉換器**。

   您可以使用**輸入轉換器**選項，指定重複資料刪除字串和 OpsItems 的其他重要資訊，例如標題和嚴重性。

1. 選擇**設定輸入轉換器**。

1. 在**目標輸入轉換器**的**輸入路徑**中，指定針對觸發事件要剖析的值。例如，若要透過觸發規則的事件來剖析開始時間、結束時間和其他詳細資訊，請使用下列 JSON。

   ```
   {
       "end-time": "$.detail.EndTime",
       "failure-cause": "$.detail.cause",
       "resources": "$.resources[0]",
       "source": "$.detail.source",
       "start-time": "$.detail.StartTime"
   }
   ```

1. 針對 **Template** (範本)，指定要傳送至目標的資訊。例如，使用下列 JSON 將資訊傳遞至 OpsCenter。該資訊用於建立 OpsItem。
**注意**  
如果輸入範本為 JSON 格式，則範本中的物件值不能包含引號。例如，資源、失敗原因、來源、開始時間和結束時間的值不能加引號。

   ```
   {
       "title": "EBS snapshot copy failed",
       "description": "CloudWatch Event Rule SSMOpsItems-EBS-snapshot-copy-failed was triggered. Your EBS snapshot copy has failed. See below for more details.",
       "category": "Availability",
       "severity": "2",
       "source": "EC2",
       "operationalData": {
           "/aws/dedup": {
               "type": "SearchableString",
               "value": "{\"dedupString\":\"SSMOpsItems-EBS-snapshot-copy-failed\"}"
           },
           "/aws/automations": {
               "value": "[ { \"automationType\": \"AWS:SSM:Automation\", \"automationId\": \"AWS-CopySnapshot\" } ]"
           },
           "failure-cause": {
               "value": <failure-cause>
           },
           "source": {
               "value": <source>
           },
           "start-time": {
               "value": <start-time>
           },
           "end-time": {
               "value": <end-time>
           },
            },
           "resources": {
               "value": <resources>
           }
       }
   }
   ```

   如需這些欄位的詳細資訊，請參閱《*Amazon EventBridge 使用者指南*》中的[轉換目標輸入](https://docs.aws.amazon.com/eventbridge/latest/userguide/transform-input.html)。

1. 選擇**確認**。

1. 選擇**下一步**。

1. 選擇**下一步**。

1. 選擇**更新規則**。

從事件建立 OpsItem 之後，您就可以開啟 OpsItem 並向下捲動至 **Private operational data (私有營運資料)** 區段，檢視事件詳細資訊。如需如何在 OpsItem 中設定選項的資訊，請參閱 [管理 OpsItems](OpsCenter-working-with-OpsItems.md)。