

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 在 EventBridge 调度器中删除计划组
<a name="managing-schedule-group-delete"></a>

在下文中，您可以学习如何使用 AWS 管理控制台 和 AWS Command Line Interface 删除计划组。删除组时，该组一直处于 `DELETING` 状态，直到 EventBridge 调度器删除该组中的所有计划。EventBridge 调度器删除组中的计划后，您的账户中将不再有该组。

**注意**  
创建组后，您无法从该组中移除计划，也无法将该计划与其他组关联。只有在首次创建计划时，才能将计划与组关联。

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

**使用 AWS 管理控制台 删除组**

1. 登录 AWS 管理控制台并打开 Amazon EventBridge 控制台 ([https://console.aws.amazon.com/events/](https://console.aws.amazon.com/events/))。

1. 在左侧导航窗格中，选择**计划组**。

1. 在**计划组**页面上，从当前 AWS 区域 的现有组列表中找到要删除的组。如果您没有看到要找的组，请选择其他 AWS 区域。
**注意**  
 您不能删除或编辑**默认**组。

1. 选中您要删除的组对应的复选框。

1. 选择**删除**。

1. 在**删除计划组**对话框中，输入该组的名称以确认您的选择，然后选择**删除**。

1. 在**计划组**列表中，**状态**列会发生变化，表示您的组现在正在**删除**。在 EventBridge 调度器删除与该组关联的所有计划之前，该组将保持此状态。

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

------