

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

# 刪除通知規則
<a name="notification-rule-delete"></a>

一個資源只能設定 10 個通知規則，因此請考慮刪除不再需要的規則。您可以使用開發人員工具主控台或 AWS CLI 來刪除通知規則。

**注意**  
刪除通知規則之後就無法復原，但您可以重新建立通知規則。刪除通知規則並不會刪除目標。<a name="notification-rule-delete-console"></a>

# 刪除通知規則 (主控台)
<a name="notification-rule-delete-console"></a>

1. 開啟位於 https：//[https://console.aws.amazon.com/codesuite/settings/notifications](https://console.aws.amazon.com/codesuite/settings/notifications/) 的 AWS 開發人員工具主控台。

1. 在導覽列中，展開 **Settings (設定)**，然後選擇 **Notification rules (通知規則)**。

1. 在**通知規則**中，檢閱 AWS 區域 您目前登入之 中針對您 AWS 帳戶中資源設定的規則。使用選擇器變更 AWS 區域。

1. 選擇通知規則，然後選擇 **Delete (刪除)**。

1. 輸入 **delete**，然後選擇 **Delete (刪除)**。<a name="notification-rule-delete-cli"></a>

# 刪除通知規則 (AWS CLI)
<a name="notification-rule-delete-cli"></a>

1. 在終端機或命令提示字元中，執行 **delete-notification-rule** 命令，並指定通知規則的 ARN。

   ```
   aws codestar-notifications delete-notification-rule --arn arn:aws:codestar-notifications:{{us-east-1}}:{{123456789012}}:notificationrule/dc82df7a-EXAMPLE
   ```

1. 如果成功，此命令會傳回所刪除通知規則的 ARN，如下所示。

   ```
   {
       "Arn": "arn:aws:codestar-notifications:{{us-east-1}}:{{123456789012}}:notificationrule/dc82df7a-EXAMPLE"
   }
   ```