

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

# AWS Config 而且 AWS Organizations
<a name="services-that-can-integrate-config"></a>

中的多帳戶、多區域資料彙總 AWS Config 可讓您將來自多個帳戶和 AWS Config 的資料彙總 AWS 區域 到單一帳戶。多帳戶多區域資料彙總對中央 IT 管理員監控企業中多個 AWS 帳戶 的合規性非常有用。彙總工具是 中的資源類型 AWS Config ， AWS Config 可從多個來源帳戶和區域收集資料。在您要查看彙總 AWS Config 資料的區域中建立彙總工具。建立彙總工具時，您可以選擇新增個別帳戶 ID 或您的組織。如需 的詳細資訊 AWS Config，請參閱 [AWS Config 開發人員指南](https://docs.aws.amazon.com/config/latest/developerguide/)。

您也可以使用 [AWS Config APIs](https://docs.aws.amazon.com/config/latest/APIReference/welcome.html) 來管理 AWS Config 組織中所有 AWS 帳戶 的規則。如需詳細資訊，請參閱《 *AWS Config 開發人員指南*》[中的在您的組織中所有帳戶中啟用 AWS Config 規則](https://docs.aws.amazon.com/config/latest/developerguide/config-rule-multi-account-deployment.html)。

使用下列資訊來協助您 AWS Config 整合 AWS Organizations。



## 服務連結角色
<a name="integrate-enable-slr-config"></a>

下列[服務連結角色](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html)允許 在您的組織中的帳戶內 AWS Config 執行支援的操作。
+ `AWSServiceRoleForConfig`

進一步了解如何在 *AWS Config 開發人員指南*中[為指派給 的 IAM 角色的許可中建立此角色 AWS Config](https://docs.aws.amazon.com/config/latest/developerguide/iamrole-permissions.html) 

《 *AWS Config 開發人員指南*》中的進一步了解如何在使用 AWS Config 的服務連結角色 中使用服務連結角色 [AWS Config](https://docs.aws.amazon.com/config/latest/developerguide/using-service-linked-roles.html) 

只有在您停用 AWS Config 和 Organizations 之間的受信任存取，或者從組織中刪除成員帳戶時，才能移除或修改此角色。

## 使用 啟用受信任存取 AWS Config
<a name="integrate-enable-ta-config"></a>

如需啟用受信任存取所需許可的資訊，請參閱[啟用信任的存取所需的許可](orgs_integrate_services.md#orgs_trusted_access_perms)。

您可以使用 AWS Config 主控台或 AWS Organizations 主控台啟用受信任存取。

**重要**  
我們強烈建議您盡可能使用 AWS Config 主控台或工具來啟用與 Organizations 的整合。這可讓 AWS Config 執行其所需的任何組態，例如建立 服務所需的資源。只有在您無法使用 AWS Config提供的工具啟用整合時，才能繼續執行這些步驟。如需詳細資訊，請參閱[本說明](orgs_integrate_services.md#important-note-about-integration)。  
如果您使用 AWS Config 主控台或工具啟用受信任存取，則不需要完成這些步驟。

**使用 AWS Config 主控台啟用受信任存取**  
若要啟用 AWS Organizations 的受信任存取 AWS Config，請建立多帳戶彙總工具並新增組織。如需如何設定多帳戶彙整工具的資訊，請參閱《 *AWS Config 開發人員指南*》中的[建立彙整工具](https://docs.aws.amazon.com/config/latest/developerguide/aggregated-create.html)。

您可以使用 AWS Organizations 主控台、執行 AWS CLI 命令，或呼叫其中一個 AWS SDKs。

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

**使用 Organizations 主控台來啟用受信任的服務存取**

1. 登入 [AWS Organizations 主控台](https://console.aws.amazon.com/organizations/v2)。您必須以 IAM 使用者登入、擔任 IAM 角色，或是以組織管理帳戶中的根使用者 ([不建議](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials)) 身分登入。

1. 在導覽窗格中，選擇**服務**。

1. **AWS Config** 在服務清單中選擇 。

1. 選擇 **Enable trusted access (啟用信任存取)**。

1. 在**啟用受信任存取對話方塊中 AWS Config**，輸入**啟用**以確認，然後選擇**啟用受信任存取**。

1. 如果您只是 的管理員 AWS Organizations，請告訴管理員 AWS Config ，他們現在可以從服務主控台 啟用該服務來使用 AWS Organizations 。

------
#### [ AWS CLI, AWS API ]

**使用 Organizations CLI/SDK 來啟用受信任服務存取**  
使用下列 AWS CLI 命令或 API 操作來啟用受信任的服務存取：
+ AWS CLI: [enable-aws-service-access](https://docs.aws.amazon.com/cli/latest/reference/organizations/enable-aws-service-access.html)

  執行下列命令，以 Organizations 將 啟用 AWS Config 為信任的服務。

  ```
  $ aws organizations enable-aws-service-access \ 
      --service-principal config.amazonaws.com
  ```

  此命令成功後就不會產生輸出。
+ AWS API：[EnableAWSServiceAccess](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html)

------

## 使用 停用受信任存取 AWS Config
<a name="integrate-disable-ta-config"></a>

如需啟用受信任的存取所需許可的資訊，請參閱[停用信任的存取所需的許可](orgs_integrate_services.md#orgs_trusted_access_disable_perms)。

您只能使用 Organizations 工具停用受信任存取。

您可以透過執行 Organizations AWS CLI 命令或呼叫其中一個 AWS SDKs。

------
#### [ AWS CLI, AWS API ]

**使用 Organizations CLI/SDK 來停用受信任服務存取**  
使用下列 AWS CLI 命令或 API 操作來停用受信任的服務存取：
+ AWS CLI: [disable-aws-service-access](https://docs.aws.amazon.com/cli/latest/reference/organizations/disable-aws-service-access.html)

  執行下列命令，以 Organizations 將 停用 AWS Config 為信任的服務。

  ```
  $ aws organizations disable-aws-service-access \
      --service-principal config.amazonaws.com
  ```

  此命令成功後就不會產生輸出。
+ AWS API：[DisableAWSServiceAccess](https://docs.aws.amazon.com/organizations/latest/APIReference/API_DisableAWSServiceAccess.html)

------