Ongoing service disruptions
For the most recent update on ongoing service disruptions affecting the AWS Middle East (UAE) Region (ME-CENTRAL-1), refer to the AWS Health Dashboard. For information on AWS Service migration, see How do I migrate my services to another region?
為什麼我無法在 AWS Config 中為 AWS Organizations 建立或刪除組態規則?
當我嘗試為 AWS Organizations 建立或刪除 AWS Config 規則時,我收到 CREATE_FAILED 或 DELETE_FAILED 錯誤。
簡短描述
各種問題都可能導致組織組態規則無法運作,包括以下範例:
- 權限
- 非作用中的會員帳戶
- 缺少組態記錄器
若要解決組織組態規則錯誤,請完成以下步驟:
- 尋找會員帳戶規則的狀態詳細資訊。
- 對規則失敗的原因進行疑難排解。
解決方法
**注意:**如果您在執行 AWS Command Line Interface (AWS CLI) 命令時收到錯誤訊息,請參閱對 AWS CLI 錯誤進行疑難排解。此外,請確定您使用的是最新的 AWS CLI 版本。
尋找會員帳戶規則的狀態詳細資訊
若要尋找會員帳戶規則的失敗和成功狀態詳細資訊,請執行 get-organization-config-rule-detailed-status 命令:
aws configservice get-organization-config-rule-detailed-status --organization-config-rule-name your-rule-name
**注意:**將 your-rule-name 替換為您的組織組態規則名稱。
查看輸出 ErrorCode 和 ErrorMessage,了解規則失敗的原因詳細資訊。
對規則失敗的原因進行疑難排解
確認會員帳戶是否處於作用中狀態
若要確認所有會員帳戶是否處於活動狀態,請執行 list-accounts 命令:
aws organizations list-accounts --query 'Accounts[*].[Id, Status]' --output table
為會員帳戶設定 AWS Config
若要為每個會員帳戶設定 AWS Config,請使用主控台、AWS CLI 或 AWS CloudFormation。為所有會員帳戶設定 AWS Config 後,執行 put-organization-config-rule 以再次部署規則。
查看您的事件日誌
開啟 AWS CloudTrail console (AWS CloudTrail 主控台),然後從導覽窗格中選擇 Event history (事件歷史記錄)。若要篩選日誌,請從下拉式清單中選擇 Event name (事件名稱),然後在搜尋欄位中輸入 PutOrganizationConfigRule 或 DeleteOrganizationConfigRule。檢視已篩選的日誌結果,尋找 OrganizationAccessDeniedException 錯誤。
更新委派管理員會員帳戶
您必須從 AWS Organizations 管理帳戶或委派管理員會員帳戶進行呼叫。如果您從這些帳戶外進行呼叫 (例如 PutOrganizationConfigRule API 或 DeleteOrganizationConfigRule API),則呼叫會失敗。
若要識別委派管理員會員帳戶,請執行 list-delegated administrators 命令:
aws organizations list-delegated-administrators --service-principal=config-multiaccountsetup.amazonaws.com
更新您的權限
如果您收到 OrganizationAccessDeniedException 錯誤,那麼您可能沒有所需的權限。AWS Config 的 AWS Identity and Access Management (IAM) 角色必須包含下列權限才能建立和刪除組織組態規則:
- PutConfigRule
- PutOrganizationConfigRule
- DeleteOrganizationConfigRule
如需詳細資訊,請參閱指派給 AWS Config 的 IAM 角色權限。
查看錯誤訊息
如果您收到 ResourceInUseException 錯誤,請查看錯誤訊息以確定原因。
- 如果錯誤訊息指出修復動作與該規則相關聯,請解析修復動作。
- 如果錯誤訊息表示規則狀態不是 CREATE_SUCCESSFUL,請確認 AWS Config 會員帳戶 IAM 角色是否包含 DeleteConfigRule 權限。
建立自訂組織組態規則
如果 AWS Lambda 函式資源政策不允許 AWS Config 服務主體調用該政策,則執行 add-permission 命令來提供權限:
aws lambda add-permission --function-name function-name --region region --action "lambda:InvokeFunction" --principal config.amazonaws.com --source-account source-account --statement-id Allow
**注意:**將 function-name 替換為您的 Lambda 函式名稱,將 region 替換為您的 AWS 區域,並將 source-account 替換為管理帳戶 ID。
若要為組織中的多個會員帳戶授予權限,請為每個會員帳戶執行該命令。將 source-account 替換為每個會員帳戶 ID。
相關資訊
- 語言
- 中文 (繁體)
