

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

# 在 EventBridge 排程器中刪除排程群組
<a name="managing-schedule-group-delete"></a>

在以下，您可以了解如何使用 AWS 管理主控台 和 刪除排程群組 AWS Command Line Interface。當您刪除群組時，會處於 `DELETING` 狀態，直到 EventBridge Scheduler 刪除群組中的所有排程為止。EventBridge Scheduler 刪除群組中的排程後，您的帳戶就不再提供該群組。

**注意**  
建立群組後，您無法從該群組中移除排程，或將排程與不同的群組建立關聯。您只能在第一次建立排程時將排程與群組建立關聯。

------
#### [ AWS 管理主控台 ]

**使用 刪除群組 AWS 管理主控台**

1. 登入 AWS 管理主控台 ，並在 [https://console.aws.amazon.com/events/](https://console.aws.amazon.com/events/)：// 開啟 Amazon EventBridge 主控台。

1. 在左側導覽窗格中，選擇左側導覽窗格中的**排程群組**。

1. 在**排程群組**頁面上，從目前 中的現有群組清單中 AWS 區域，找到您要刪除的群組。如果您沒有看到要尋找的群組，請選擇另一個群組 AWS 區域。
**注意**  
 您無法刪除或編輯**預設**群組。

1. 選取您要刪除之群組的核取方塊。

1. 選擇 **刪除** 。

1. 在**刪除排程群組**對話方塊中，輸入群組的名稱以確認您的選擇，然後選擇**刪除**。

1. 在**排程群組**清單中，**狀態**資料欄會變更，指出您的群組現在正在**刪除**。群組會保持此狀態，直到 EventBridge Scheduler 刪除與該群組相關聯的所有排程為止。

1. 若要重新整理清單並確認群組已刪除，請選擇**重新整理**圖示。

------
#### [ AWS CLI ]

**使用 刪除群組 AWS CLI**

1. 開啟新的命令提示視窗。

1. 從 AWS Command Line Interface (AWS CLI) 輸入下列[https://awscli.amazonaws.com/v2/documentation/api/latest/reference/scheduler/delete-schedule-group.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/scheduler/delete-schedule-group.html)命令來刪除排程群組。將 的值取代`--name`為您的資訊。

   ```
   $ aws scheduler delete-schedule-group --name TestGroup
   ```

    如果成功， AWS CLI 此操作不會傳回回應。

1. 若要驗證群組是否處於 `DELETING` 狀態，請執行下列[https://awscli.amazonaws.com/v2/documentation/api/latest/reference/scheduler/get-schedule-group.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/scheduler/get-schedule-group.html)命令。

   ```
   $ aws scheduler get-schedule-group --name TestGroup
   ```

    如果成功，您會收到類似下列的輸出：

   ```
   {
       "Arn": "arn:aws::scheduler:us-west-2:123456789012:schedule-group/TestGroup",
       "CreationDate": "2023-01-01T09:00:00.000000-07:00",
       "LastModificationDate": "2023-01-01T09:00:00.000000-07:00",
       "Name": "TestGroup",
       "State": "DELETING"
   }
   ```

   EventBridge 排程器會在刪除與群組相關聯的排程後刪除群組。如果您`get-schedule-group`再次執行，會收到下列`ResourceNotFoundException`回應：

   ```
   An error occurred (ResourceNotFoundException) when calling the GetScheduleGroup operation: Schedule group TestGroup does not exist.
   ```

------