

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

# 编辑 Amazon Config 聚合器
<a name="aggregated-edit"></a>

您可以使用 Amazon Config 控制台或 Amazon CLI 编辑聚合器。

------
#### [ Editing Aggregators (Console) ]

1. 登录到，Amazon Web Services 管理控制台然后通过以下网址打开 Amazon Config 控制台：[https://console.aws.amazon.com/config/home](https://console.amazonaws.cn/config/home)。

1. 导航到**聚合器**页面，然后选择聚合器名称。

1. 选择 **Actions**，然后选择 **Edit**。

1. 使用**编辑聚合器**页面上的相关部分来更改聚合器的源账户、IAM 角色或区域。
**注意**  
您无法将源类型从个人账户更改为组织，反之亦然。

1. 选择**保存**。

------
#### [ Editing Aggregators (Amazon CLI) ]

1. 您可以使用 `put-configuration-aggregator` 命令来更新或编辑配置聚合器。

   输入以下命令以向 **MyAggregator** 添加新的账户 ID：

   ```
   aws configservice put-configuration-aggregator --configuration-aggregator-name MyAggregator --account-aggregation-sources "[{\"AccountIds\": [\"{{AccountID1}}\",\"{{AccountID2}}\",\"{{AccountID3}}\"],\"AllAwsRegions\": true}]"
   ```

1. 根据您的源账户，您应该看到类似于以下内容的输出：

   **对于个人账户**

   ```
   {
       "ConfigurationAggregator": {
           "ConfigurationAggregatorArn": "arn:aws:config:{{Region}}:{{AccountID}}:config-aggregator/config-aggregator-xz2upuu6",
           "CreationTime": 1517952090.769,
           "ConfigurationAggregatorName": "MyAggregator",
           "AccountAggregationSources": [
               {
                   "AllAwsRegions": true,
                   "AccountIds": [
                       "AccountID1",
                       "AccountID2",
                       "AccountID3",
                       "AccountID4"
                   ]
               }
           ],
           "LastUpdatedTime": 1517952566.445
       }
   }
   ```

   或

   **对于组织**

   ```
   {
       "ConfigurationAggregator": {
           "ConfigurationAggregatorArn": "arn:aws:config:{{Region}}:{{AccountID}}:config-aggregator/config-aggregator-floqpus3",
           "CreationTime": 1517942461.442,
           "ConfigurationAggregatorName": "MyAggregator",
           "OrganizationAggregationSource": {
                   "AllAwsRegions": true,
                   "RoleArn": "arn:aws:iam::{{account-of-role-to-assume}}:role/{{name-of-role}}"
            },
           "LastUpdatedTime": 1517942461.442
       }
   }
   ```

------