

• 2026 年 4 月 30 日之後， AWS Systems Manager CloudWatch Dashboard 將不再可用。客戶可以繼續使用 Amazon CloudWatch 主控台來檢視、建立和管理其 Amazon CloudWatch 儀表板，就像現在一樣。如需詳細資訊，請參閱 [Amazon CloudWatch Dashboard 文件](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html)。

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

# 設定 OpsCenter
<a name="OpsCenter-setup"></a>

AWS Systems Manager 使用整合式設定來協助您開始使用 OpsCenter 和 Explorer (Systems Manager 中的工具)。Explorer 是可自訂操作儀表板，用於報告 AWS 資源的相關資訊。在本文件中，Explorer 和 OpsCenter 設定稱為*整合式設定*。

您必須使用整合式設定來透過 Explorer 設定 OpsCenter。整合式設定僅適用於 AWS Systems Manager 主控台。您無法以程式設計方式設定 Explorer 和 OpsCenter。如需更多詳細資訊，請參閱 [開始使用 Systems Manager Explorer 和 OpsCenter](Explorer-setup.md)。

**開始之前**  
當您設定 OpsCenter 時，您可以在自動建立 OpsItems 的 Amazon EventBridge 中啟用預設規則。下表說明自動建立 OpsItems 的預設 EventBridge 規則。您可以在 **OpsItem 規則**下的 OpsCenter **設定**頁面中停用 EventBridge 規則。

**重要**  
系統針對預設規則建立的 OpsItems 向您的帳戶收取費用。如需詳細資訊，請參閱[AWS Systems Manager定價](https://aws.amazon.com/systems-manager/pricing/)。


****  

| 規則名稱 | 描述 | 
| --- | --- | 
|  SSMOpsItems-Autoscaling-instance-launch-failure  |  此規則會在 EC2 自動擴展執行個體啟動失敗時建立 OpsItems。  | 
|  SSMOpsItems-Autoscaling-instance-termination-failure  |  此規則會在 EC2自動擴展執行個體終止失敗時建立 OpsItems。  | 
|  SSMOpsItems-EBS-snapshot-copy-failed  |  此規則會在系統複製 Amazon Elastic Block Store (Amazon EBS) 快照失敗時建立 OpsItems。  | 
|  SSMOpsItems-EBS-snapshot-creation-failed  |  此規則會在系統建立 Amazon EBS 快照失敗時建立 OpsItems。  | 
|  SSMOpsItems-EBS-volume-performance-issue  |  此規則對應於 AWS Health 追蹤規則。該規則會在 Amazon EBS 磁碟區 (運作狀態事件 = `AWS_EBS_DEGRADED_EBS_VOLUME_PERFORMANCE`) 發生效能問題時建立 OpsItems。  | 
|  SSMOpsItems-EC2-issue  |  此規則對應於影響 AWS 服務或資源的未預期事件的 AWS Health 追蹤規則。該規則會建立 OpsItems，例如，服務傳送有關造成服務降級之操作問題的通訊，或提高本地化資源層級問題的意識。例如，此規則會為下列事件建立 OpsItem：`AWS_EC2_OPERATIONAL_ISSUE`。  | 
|  SSMOpsItems-EC2-scheduled-change  |  此規則對應於 AWS Health 追蹤規則。AWS 可為執行個體排程事件，例如重新開機、停止或啟動執行個體。該規則會為 EC2 已排程事件建立 OpsItems。如需有關已排程事件的詳細資訊，請參閱《Amazon EC2 使用者指南》**中的 [Scheduled events for your instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html)。  | 
|  SSMOpsItems-RDS-issue  |  此規則對應於影響 AWS 服務或資源的未預期事件的 AWS Health 追蹤規則。該規則會建立 OpsItems，例如，服務傳送有關造成服務降級之操作問題的通訊，或提高本地化資源層級問題的意識。例如，此規則會為下列事件建立 OpsItem：`AWS_RDS_MYSQL_DATABASE_CRASHING_REPEATEDLY`、`AWS_RDS_EXPORT_TASK_FAILED` 和 `AWS_RDS_CONNECTIVITY_ISSUE`。  | 
|  SSMOpsItems-RDS-scheduled-change  |  此規則對應於 AWS Health 追蹤規則。該規則會為 Amazon RDS 已排程事件建立 OpsItems。已排程事件會提供 Amazon RDS 資源即將發生之變更的相關資訊。部分事件可能會建議您採取行動以避免服務中斷。其他事件會自動發生，您無需採取任何動作。在已排定變更活動期間，您的資源可能暫時無法使用。例如，此規則會為下列事件建立 OpsItem：`AWS_RDS_SYSTEM_UPGRADE_SCHEDULED` 和 `AWS_RDS_MAINTENANCE_SCHEDULED`。如需有關已排程事件的詳細資訊，請參閱《*AWS Health 使用者指南*》中的[事件類型類別](https://docs.aws.amazon.com/health/latest/ug/aws-health-concepts-and-terms.html#event-type-categories)。  | 
|  SSMOpsItems-SSM-maintenance-window-execution-failed  |  此規則會在處理 Systems Manager 維護視窗失敗時建立 OpsItems。  | 
|  SSMOpsItems-SSM-maintenance-window-execution-timedout  |  此規則會在啟動「系統維護」視窗逾時時建立 OpsItems。  | 

使用下列程序來設定 OpsCenter。

**設定 OpsCenter**

1. 開啟位於 [https://console.aws.amazon.com/systems-manager/](https://console.aws.amazon.com/systems-manager/) 的 AWS Systems Manager 主控台。

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

1. 在 OpsCenter 首頁上，選擇**入門**。

1. 在 OpsCenter 設定頁面上，選擇**啟用此選項，讓 Explorer 設定 AWS Config 和 Amazon CloudWatch Events 以根據常用規則和事件自動建立 OpsItems**。如果不選擇此選項，OpsCenter 會保持停用。
**注意**  
Amazon EventBridge (前稱為 Amazon CloudWatch Events) 不僅提供 CloudWatch Events 的所有功能，還提供一些新功能，例如自訂事件匯流排、第三方事件來源和結構描述登錄檔。

1. 選擇 **啟用OpsCenter** 。

啟用 OpsCenter 後，您可以從**設定**執行以下操作：
+ 使用**打開 CloudWatch 主控台**按鈕建立 CloudWatch 警示。如需更多詳細資訊，請參閱 [設定 CloudWatch 警示以建立 OpsItems](OpsCenter-create-OpsItems-from-CloudWatch-Alarms.md)。
+ 啟用操作洞察。如需更多詳細資訊，請參閱 [分析操作洞察以減少 OpsItems](OpsCenter-working-operational-insights.md)。
+ 啟用 AWS Security Hub CSPM 問題清單警示。如需更多詳細資訊，請參閱 [了解與 的OpsCenter整合 AWS Security Hub CSPM](OpsCenter-applications-that-integrate.md#OpsCenter-integrate-with-security-hub)。

**Topics**
+ [(選用) 設定 OpsCenter 以跨帳戶集中管理 OpsItems](OpsCenter-setting-up-cross-account.md)
+ [(選用) 設定 Amazon SNS 以接收有關 OpsItems 的通知](OpsCenter-getting-started-sns.md)

# (選用) 設定 OpsCenter 以跨帳戶集中管理 OpsItems
<a name="OpsCenter-setting-up-cross-account"></a>

您可以使用 Systems Manager OpsCenter 集中管理所選 AWS 帳戶 中的OpsItems多個 AWS 區域。在 中設定您的組織後，即可使用此功能 AWS Organizations。 AWS Organizations 是一種帳戶管理服務，可讓您將多個 AWS 帳戶合併到您建立並集中管理的組織。 AWS Organizations 包含帳戶管理和合併帳單功能，可讓您更完善地滿足業務的預算、安全和合規需求。如需詳細資訊，請參閱*AWS Organizations 《 使用者指南*》中的[什麼是 AWS Organizations？](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html) 

屬於 AWS Organizations 管理帳戶的使用者可以為 Systems Manager 設定委派管理員帳戶。對於 OpsCenter 而言，受委派管理員可以建立、編輯和檢視成員帳戶中的 OpsItems。委派管理員也可以使用 Systems Manager Automation Runbook 大量解決OpsItems或修復產生 AWS 的資源問題OpsItems。

**注意**  
您只能將一個帳戶指定為 Systems Manager 的受委派管理員。如需詳細資訊，請參閱[為 Systems Manager 建立 AWS Organizations 委派管理員](setting_up_delegated_admin.md)。

Systems Manager 提供下列方法來設定 OpsCenter 以跨多個 AWS 帳戶集中管理 OpsItems。
+ **Quick Setup**：Quick Setup 是 Systems Manager 中的工具，可簡化 Systems Manager 工具的設定和組態任務。如需詳細資訊，請參閱[AWS Systems Manager Quick Setup](systems-manager-quick-setup.md)。

  OpsCenter 的快速設定可協助您完成實現跨帳戶管理 OpsItems 所需進行的下列任務：
  + 將一個帳戶註冊為受委派管理員 (如果尚未指定受委派管理員)
  + 建立 required AWS Identity and Access Management (IAM) 政策和角色
  + 指定委派管理員可以OpsItems跨帳戶管理 AWS Organizations 的組織或組織單位 (OUs)

  如需詳細資訊，請參閱[(選用) 使用 Quick Setup 設定 OpsCenter 以跨帳戶管理 OpsItems](OpsCenter-quick-setup-cross-account.md)。
**注意**  
快速設定不適用於目前可使用 Systems Manager 的所有 AWS 區域 。如果您使用的區域無法使用快速設定對 OpsCenter 進行設定以實現跨多個帳戶集中管理 OpsItems，則您必須使用手動方法。若要檢視可使用快速設定 AWS 區域 的位置清單，請參閱 [Quick Setup 中的 可用性 AWS 區域](systems-manager-quick-setup.md#quick-setup-getting-started-regions)。
+ **手動設定**：如果您使用的區域無法使用快速設定對 OpsCenter 進行設定以實現跨多個帳戶集中管理 OpsItems，則您可以使用手動方法實現。如需詳細資訊，請參閱[(選用) 手動設定 OpsCenter 以跨帳戶集中管理 OpsItems](OpsCenter-getting-started-multiple-accounts.md)。

# (選用) 使用 Quick Setup 設定 OpsCenter 以跨帳戶管理 OpsItems
<a name="OpsCenter-quick-setup-cross-account"></a>

Quick Setup中的工具 AWS Systems Manager可簡化 Systems Manager 工具的設定和組態任務。 Quick Setup for OpsCenter可協助您完成下列OpsItems跨帳戶管理任務：
+ 指定受委派管理員帳戶
+ 建立 required AWS Identity and Access Management (IAM) 政策和角色
+ 指定 AWS Organizations 組織或成員帳戶的子集，委派管理員可以OpsItems跨帳戶管理

當您設定 OpsCenter 以使用快速設定跨帳號管理 OpsItems 時，Quick Setup 會在指定的帳戶中建立下列資源。這些資源提供指定帳戶使用 的許可OpsItems，並使用 Automation Runbook 修正產生 之 AWS 資源的問題OpsItems。


****  

| Resources | 帳戶 | 
| --- | --- | 
|  `AWSServiceRoleForAmazonSSM_AccountDiscovery` AWS Identity and Access Management (IAM) 服務連結的角色 如需有關此角色的詳細資訊，請參閱 [使用 角色來收集 OpsCenter和 AWS 帳戶 的資訊 Explorer](using-service-linked-roles-service-action-2.md)。  |  AWS Organizations 管理帳戶和委派管理員帳戶  | 
|  `OpsItem-CrossAccountManagementRole` IAM 角色  `AWS-SystemsManager-AutomationAdministrationRole` IAM 角色  |  委派管理員帳戶  | 
|  `OpsItem-CrossAccountExecutionRole` IAM 角色  `AWS-SystemsManager-AutomationExecutionRole` IAM 角色  適用於預設 OpsItem 群組 (`OpsItemGroup`) 的 `AWS::SSM::ResourcePolicy` Systems Manager 資源政策  |  所有 AWS Organizations 成員帳戶  | 

**注意**  
如果您先前OpsCenter已設定使用[手動方法](https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-getting-started-multiple-accounts.html)OpsItems跨帳戶管理 ，則必須刪除在該程序的步驟 4 和 5 期間建立的 AWS CloudFormation 堆疊或堆疊集。當您完成以下程序時，如果這些資源存在於您的帳戶中，則 Quick Setup 無法正確設定跨帳戶 OpsItem 管理。

**使用快速設定設定 OpsCenter 以跨帳戶管理 OpsItems**

1.  AWS 管理主控台 使用 AWS Organizations 管理帳戶登入 。

1. 在 https：//[https://console.aws.amazon.com/systems-manager/](https://console.aws.amazon.com/systems-manager/) 開啟 AWS Systems Manager 主控台。

1. 在導覽窗格中，選擇 **Quick Setup**。

1. 選擇**程式庫**索引標籤。

1. 捲動至底部並找到 **OpsCenter** 組態圖磚。選擇**建立**。

1. 在 Quick Setup OpsCenter 頁面的**受委派管理員**區段中，輸入帳戶 ID。如果您無法編輯此欄位，則表示已為 Systems Manager 指定受委派管理員帳戶。

1. 在 **Targets** (目標) 區段中，選擇一個選項。如果您選擇**自訂**，請選取您要跨帳戶管理 OpsItems 的組織單位 (OU)。

1. 選擇**建立**。

Quick Setup 會建立 OpsCenter 組態並將必要的 AWS 資源部署到指定的 OU。

**注意**  
如果您不想跨多個帳戶管理 OpsItems，可以從 Quick Setup 中刪除相關組態。刪除組態時，Quick Setup 會刪除最初部署組態時建立的下列 IAM 政策和角色：  
受委派管理員帳戶的 `OpsItem-CrossAccountManagementRole`
來自所有 Organizations 成員帳戶的 `OpsItem-CrossAccountExecutionRole` 和 `SSM::ResourcePolicy`
Quick Setup 會移除所有組織單位以及最初部署組態的 AWS 區域 中的組態。

## 使用 OpsCenter 的 Quick Setup 組態診斷並解決問題
<a name="OpsCenter-quick-setup-cross-account-troubleshooting"></a>

本節包含的資訊可協助您在使用 Quick Setup 設定跨帳戶 OpsItem 管理時診斷並解決問題。

**Topics**
+ [部署到這些堆疊集失敗：delegatedAdmin](#OpsCenter-quick-setup-cross-account-troubleshooting-stack-set-failed)
+ [Quick Setup 組態狀態顯示失敗](#OpsCenter-quick-setup-cross-account-troubleshooting-configuration-failed)

### 部署到這些堆疊集失敗：delegatedAdmin
<a name="OpsCenter-quick-setup-cross-account-troubleshooting-stack-set-failed"></a>

建立 OpsCenter 組態時，Quick Setup 會在 Organizations 管理帳戶中部署兩個 AWS CloudFormation 堆疊集。這些堆疊集使用以下字首：`AWS-QuickSetup-SSMOpsCenter`。如果 Quick Setup 顯示以下錯誤：`Deployment to these StackSets failed: delegatedAdmin` 使用以下程序來修正此問題。

**診斷並解決 "StackSets failed:delegatedAdmin" 錯誤**

1. 如果您在Quick Setup主控台的紅色橫幅中收到`Deployment to these StackSets failed: delegatedAdmin`錯誤，請登入委派管理員帳戶，並將 AWS 區域 指定為Quick Setup主要區域。

1. 在 https：//[https://console.aws.amazon.com/cloudformation](https://console.aws.amazon.com/cloudformation/) 開啟 CloudFormation 主控台。

1. 選擇 Quick Setup 組態建立的堆疊。堆疊名稱包含下列項目：**AWS-QuickSetup-SSMOpsCenter**。
**注意**  
CloudFormation 有時會刪除失敗的堆疊部署。如果堆疊在**堆疊**資料表中不可用，請從篩選條件清單中選擇**已刪除**。

1. 檢視 **Status** (狀態) 和 **Status reason** (狀態原因)。如需堆疊狀態的詳細資訊，請參閱《AWS CloudFormation 使用者指南**》中的[堆疊狀態碼](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-view-stack-data-resources.html#cfn-console-view-stack-data-resources-status-codes)。

1. 要想了解失敗的確切步驟，請在**事件**標籤中檢視每個事件的**狀態**。如需詳細資訊，請參閱《AWS CloudFormation 使用者指南》**中的[故障診斷](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html)一節。

**注意**  
如果無法使用 CloudFormation 故障診斷步驟解決部署失敗問題，請刪除組態後再試一次。

### Quick Setup 組態狀態顯示失敗
<a name="OpsCenter-quick-setup-cross-account-troubleshooting-configuration-failed"></a>

如果**組態詳細資訊**頁面上的**組態詳細資訊**資料表顯示 的組態狀態`Failed`，請登入失敗的 AWS 帳戶 和 區域。

**診斷並解決因 Quick Setup 失敗而無法建立 OpsCenter 組態的問題**

1. 登入失敗發生的 AWS 帳戶 和 AWS 區域 。

1. 在 https：//[https://console.aws.amazon.com/cloudformation](https://console.aws.amazon.com/cloudformation/) 開啟 CloudFormation 主控台。

1. 選擇 Quick Setup 組態建立的堆疊。堆疊名稱包含下列項目：**AWS-QuickSetup-SSMOpsCenter**。
**注意**  
CloudFormation 有時會刪除失敗的堆疊部署。如果堆疊在**堆疊**資料表中不可用，請從篩選條件清單中選擇**已刪除**。

1. 檢視 **Status** (狀態) 和 **Status reason** (狀態原因)。如需堆疊狀態的詳細資訊，請參閱《AWS CloudFormation 使用者指南**》中的[堆疊狀態碼](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-view-stack-data-resources.html#cfn-console-view-stack-data-resources-status-codes)。

1. 要想了解失敗的確切步驟，請在**事件**標籤中檢視每個事件的**狀態**。如需詳細資訊，請參閱《AWS CloudFormation 使用者指南》**中的[故障診斷](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html)一節。

#### 成員帳戶組態顯示 ResourcePolicyLimitExceededException
<a name="OpsCenter-quick-setup-cross-account-troubleshooting-policy-limit-exception"></a>

如果某個堆疊的狀態顯示為 "`ResourcePolicyLimitExceededException`"，則表示該帳戶先前已使用[手動方法](https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-getting-started-multiple-accounts.html)加入 OpsCenter 跨帳戶管理。若要解決此問題，您必須刪除在手動加入程序的步驟 4 和 5 期間建立的 AWS CloudFormation 堆疊或堆疊集。如需詳細資訊，請參閱*AWS CloudFormation 《 使用者指南*》中的[刪除堆疊集](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-delete.html)和[刪除 CloudFormation 主控台上的堆疊](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-delete-stack.html)。

# (選用) 手動設定 OpsCenter 以跨帳戶集中管理 OpsItems
<a name="OpsCenter-getting-started-multiple-accounts"></a>

本節說明如何手動設定 OpsCenter 以跨帳戶管理 OpsItem。儘管此程序仍然受到支援，但它已被使用 Systems Manager Quick Setup 的新程序所取代。如需詳細資訊，請參閱[(選用) 使用 Quick Setup 設定 OpsCenter 以跨帳戶管理 OpsItems](OpsCenter-quick-setup-cross-account.md)。

您可以設定一个中央帳戶，以便為成員帳戶手動建立 OpsItems，管理並修正這些 OpsItems。中央帳戶可以是管理帳戶，也可以是 AWS Organizations AWS Organizations 管理帳戶和 Systems Manager 委派管理員帳戶。我們建議您使用 Systems Manager 受委派的管理員帳戶作為中央帳戶。在設定 AWS Organizations之後才能使用此功能。

使用 AWS Organizations，您可以將多個 合併 AWS 帳戶 到您集中建立和管理的組織。中央帳戶使用者可以為所有選取的成員帳戶同時建立 OpsItems，並管理這些 OpsItems。

使用本節中的程序，在 Organizations 中啟用 Systems Manager 服務主體，並設定 AWS Identity and Access Management (IAM) 許可以OpsItems跨帳戶使用 。

**Topics**
+ [開始之前](#OpsCenter-before-you-begin)
+ [步驟 1：建立資源資料同步](#OpsCenter-getting-started-multiple-accounts-onboarding-rds)
+ [步驟 2：在 中啟用 Systems Manager 服務主體 AWS Organizations](#OpsCenter-getting-started-multiple-accounts-onboarding-service-principal)
+ [步驟 3：建立 `AWSServiceRoleForAmazonSSM_AccountDiscovery` 服務連結角色](#OpsCenter-getting-started-multiple-accounts-onboarding-SLR)
+ [步驟 4：設定跨帳戶使用 OpsItems 的許可](#OpsCenter-getting-started-multiple-accounts-onboarding-resource-policy)
+ [步驟 5：設定跨帳戶使用相關資源的許可](#OpsCenter-getting-started-multiple-accounts-onboarding-related-resources-permissions)

**注意**  
跨帳戶使用 OpsCenter 時，僅支援 `/aws/issue` 類型的 OpsItems。

## 開始之前
<a name="OpsCenter-before-you-begin"></a>

在設定 OpsItems 來跨帳戶使用 OpsCenter 之前，請確定您已設定下列項目：
+ Systems Manager 委派管理員帳戶。如需詳細資訊，請參閱[設定 Explorer 的委派管理員](Explorer-setup-delegated-administrator.md)。
+ 在 Organizations 中設定了一個組織。如需詳細資訊，請參閱 *AWS Organizations 使用者指南*中的[建立和管理組織](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org.html)。
+ 您已將 Systems Manager Automation 設定為跨多個 AWS 區域 和 AWS 帳戶執行自動化 Runbook。如需詳細資訊，請參閱[在多個 AWS 區域 和 帳戶中執行自動化](running-automations-multiple-accounts-regions.md)。

## 步驟 1：建立資源資料同步
<a name="OpsCenter-getting-started-multiple-accounts-onboarding-rds"></a>

在您設定 和 之後 AWS Organizations，您可以透過建立資源資料同步OpsCenter來彙總整個組織的 OpsItems 。如需詳細資訊，請參閱[刪除資源資料同步](Explorer-resource-data-sync-configuring-multi.md)。建立同步時，在**新增帳戶**區段中，請務必選擇**包含我 AWS Organizations 組態中的所有帳戶**選項。

## 步驟 2：在 中啟用 Systems Manager 服務主體 AWS Organizations
<a name="OpsCenter-getting-started-multiple-accounts-onboarding-service-principal"></a>

若要讓使用者跨OpsItems帳戶使用 ，必須在其中啟用 Systems Manager 服務主體 AWS Organizations。如果您先前使用其他工具來設定多帳戶案例的 Systems Manager，則 Systems Manager 服務主體可能已在 Organizations 中設定。在 AWS Command Line Interface (AWS CLI) 中執行以下命令以進行驗證。如果您*尚未*針對其他多帳戶案例設定 Systems Manager，則請跳至下一個程序：*啟用 AWS Organizations中的 Systems Manager 服務主體*。

**若要驗證已在 中啟用 Systems Manager 服務主體 AWS Organizations**

1. 將最新版本的 [下載](https://aws.amazon.com/cli/) AWS CLI 到您的本機電腦。

1. 開啟 AWS CLI，並執行下列命令來指定您的登入資料和 AWS 區域。

   ```
   aws configure
   ```

   系統會提示您指定下列項目。在下列範例中，將每個*使用者輸入預留位置*取代為您自己的資訊。

   ```
   AWS Access Key ID [None]: key_name
   AWS Secret Access Key [None]: key_name
   Default region name [None]: region
   Default output format [None]: ENTER
   ```

1. 執行以下命令，驗證已為 AWS Organizations啟用 Systems Manager 服務主體。

   ```
   aws organizations list-aws-service-access-for-organization
   ```

   此命令會傳回與以下範例中的內容相似的資訊。

   ```
   {
       "EnabledServicePrincipals": [
           {
               "ServicePrincipal": "member.org.stacksets.cloudformation.amazonaws.com",
               "DateEnabled": "2020-12-11T16:32:27.732000-08:00"
           },
           {
               "ServicePrincipal": "opsdatasync.ssm.amazonaws.com",
               "DateEnabled": "2022-01-19T12:30:48.352000-08:00"
           },
           {
               "ServicePrincipal": "ssm.amazonaws.com",
               "DateEnabled": "2020-12-11T16:32:26.599000-08:00"
           }
       ]
   }
   ```

**在 中啟用 Systems Manager 服務主體 AWS Organizations**

如果您先前沒有為 Organizations 設定 Systems Manager 服務主體，則請使用以下程序進行設定。如需有關此命令的詳細資訊，請參閱《AWS CLI 命令參考》**中的 [enable-aws-service-access](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/organizations/enable-aws-service-access.html)。

1. 如果您尚未安裝和設定 AWS Command Line Interface (AWS CLI)。如需詳細資訊，請參閱[安裝 CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) 以及[設定 CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)。

1. 將最新版本的 [下載](https://aws.amazon.com/cli/) AWS CLI 到您的本機電腦。

1. 開啟 AWS CLI，並執行下列命令來指定您的登入資料和 AWS 區域。

   ```
   aws configure
   ```

   系統會提示您指定下列項目。在下列範例中，將每個*使用者輸入預留位置*取代為您自己的資訊。

   ```
   AWS Access Key ID [None]: key_name
   AWS Secret Access Key [None]: key_name
   Default region name [None]: region
   Default output format [None]: ENTER
   ```

1. 執行以下命令，啟用 AWS Organizations的 Systems Manager 服務主體。

   ```
   aws organizations enable-aws-service-access --service-principal "ssm.amazonaws.com"
   ```

## 步驟 3：建立 `AWSServiceRoleForAmazonSSM_AccountDiscovery` 服務連結角色
<a name="OpsCenter-getting-started-multiple-accounts-onboarding-SLR"></a>

例如 `AWSServiceRoleForAmazonSSM_AccountDiscovery`角色的服務連結角色是直接連結至 的唯一 IAM 角色類型 AWS 服務，例如 Systems Manager。服務連結角色是由服務預先定義，並包含服務 AWS 服務 代表您呼叫其他 所需的所有許可。如需 `AWSServiceRoleForAmazonSSM_AccountDiscovery` 服務連結角色的詳細資訊，請參閱[適用於 Systems Manager 帳戶探索的服務連結角色許可](using-service-linked-roles-service-action-2.md#service-linked-role-permissions-service-action-2)。

透過使用 AWS CLI，使用以下程序來建立 `AWSServiceRoleForAmazonSSM_AccountDiscovery` 服務連結角色。如需有關此程序中所用命令的詳細資訊，請參閱《AWS CLI 命令參考》**中的 [create-service-linked-role](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/create-service-linked-role.html)。

**建立 `AWSServiceRoleForAmazonSSM_AccountDiscovery` 服務連結角色**

1. 登入 AWS Organizations 管理帳戶。

1. 登入 Organizations 管理帳戶時，請執行以下命令。

   ```
   aws iam create-service-linked-role \
       --aws-service-name accountdiscovery.ssm.amazonaws.com \
       --description "Systems Manager account discovery for AWS Organizations service-linked role"
   ```

## 步驟 4：設定跨帳戶使用 OpsItems 的許可
<a name="OpsCenter-getting-started-multiple-accounts-onboarding-resource-policy"></a>

使用 AWS CloudFormation 堆疊集建立 `OpsItemGroup` 資源政策和 IAM 執行角色，提供使用者OpsItems跨帳戶使用 的許可。若要開始使用，請下載並解壓縮 [https://docs.aws.amazon.com/systems-manager/latest/userguide/samples/OpsCenterCrossAccountMembers.zip](https://docs.aws.amazon.com/systems-manager/latest/userguide/samples/OpsCenterCrossAccountMembers.zip) 檔案。此檔案包含 `OpsCenterCrossAccountMembers.yaml` CloudFormation 範本檔案。當您使用此範本建立堆疊集時，CloudFormation 會自動在帳戶中建立 `OpsItemCrossAccountResourcePolicy` 資源政策和 `OpsItemCrossAccountExecutionRole` 執行角色。如需有關建立堆疊集的詳細資訊，請參閱《AWS CloudFormation 使用者指南》**中的[建立堆疊集](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html)。

**重要**  
記下有關此任務的以下重要資訊。  
您必須在登入 AWS Organizations 管理帳戶時部署堆疊集。
您必須在登入到您希望跨帳戶使用 OpsItems 的*每個**指定*帳戶時重複此過程，包括委派管理員帳戶。
如果您想要在不同的 中啟用跨帳戶OpsItems管理 AWS 區域，請在範本的指定區域區段中選擇**新增所有**區域。 ****選擇加入區域不支援跨帳戶 OpsItem 管理。

## 步驟 5：設定跨帳戶使用相關資源的許可
<a name="OpsCenter-getting-started-multiple-accounts-onboarding-related-resources-permissions"></a>

OpsItem 可包括受影響資源 (例如 Amazon Elastic Compute Cloud (Amazon EC2) 執行個體或 Amazon Simple Storage Service (Amazon S3) 儲存貯體) 的詳細資訊。您在之前步驟 4 中建立的 `OpsItemCrossAccountExecutionRole` 執行角色會為成員帳戶提供 OpsCenter 唯讀許可，以便檢視相關資源。您還必須建立 IAM 角色，以便為管理帳戶提供檢視相關資源並與之互動的許可，您將在此任務中完成。

若要開始使用，請下載並解壓縮 [https://docs.aws.amazon.com/systems-manager/latest/userguide/samples/OpsCenterCrossAccountManagementRole.zip](https://docs.aws.amazon.com/systems-manager/latest/userguide/samples/OpsCenterCrossAccountManagementRole.zip) 檔案。此檔案包含 `OpsCenterCrossAccountManagementRole.yaml` CloudFormation 範本檔案。當您使用此範本建立堆疊時，CloudFormation 會自動在帳戶中建立 `OpsCenterCrossAccountManagementRole` IAM 角色。如需建立堆疊的詳細資訊，請參閱*AWS CloudFormation 《 使用者指南*》中的[在 AWS CloudFormation 主控台上建立堆疊](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-stack.html)。

**重要**  
記下有關此任務的以下重要資訊。  
如果您打算將帳戶指定為 的委派管理員OpsCenter，請務必在建立堆疊 AWS 帳戶 時指定該帳戶。
您必須在登入 AWS Organizations 管理帳戶時執行此程序，並在登入委派管理員帳戶時再次執行此程序。

# (選用) 設定 Amazon SNS 以接收有關 OpsItems 的通知
<a name="OpsCenter-getting-started-sns"></a>

您可以設定 OpsCenter，以在系統建立 OpsItem 或更新現有 OpsItem 時，將通知傳送至 Amazon Simple Notification Service (Amazon SNS) 主題。

完成下列步驟以接收 OpsItems 的通知。
+ [步驟 1：建立並訂閱 Amazon SNS 主題](#OpsCenter-getting-started-sns-create-topic)
+ [步驟 2：更新 Amazon SNS 存取政策](#OpsCenter-getting-started-sns-encryption-policy)
+ [步驟 3：更新 AWS KMS 存取政策](#OpsCenter-getting-started-sns-KMS-policy)
**注意**  
如果您在步驟 2 中開啟 AWS Key Management Service (AWS KMS) 伺服器端加密，則必須完成步驟 3。否則，可以略過步驟 3。
+ [步驟 4：開啟預設 OpsItems 規則以傳送有關新 OpsItems 的通知](#OpsCenter-getting-started-sns-default-rules)

## 步驟 1：建立並訂閱 Amazon SNS 主題
<a name="OpsCenter-getting-started-sns-create-topic"></a>

若要接收通知，您必須建立並訂閱 Amazon SNS 主題。如需詳細資訊，請參閱《*Amazon Simple Notification Service 開發人員指南*》中的[建立 Amazon SNS 主題](https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html)和[訂閱 Amazon SNS 主題](https://docs.aws.amazon.com/sns/latest/dg/sns-tutorial-create-subscribe-endpoint-to-topic.html)。

**注意**  
如果您在OpsCenter多個 AWS 區域 或 帳戶中使用 ，則必須在您想要接收OpsItem通知*的每個*區域或帳戶中建立並訂閱 Amazon SNS 主題。

## 步驟 2：更新 Amazon SNS 存取政策
<a name="OpsCenter-getting-started-sns-encryption-policy"></a>

您必須將 Amazon SNS 主題與 OpsItems 相關聯。使用以下程序設定 Amazon SNS 存取政策，讓 Systems Manager 可以將 OpsItems 通知發佈至您在步驟 1 中建立的 Amazon SNS 主題。

1. 登入 AWS 管理主控台 並開啟位於 https：//[https://console.aws.amazon.com/sns/v3/home](https://console.aws.amazon.com/sns/v3/home) 的 Amazon SNS 主控台。

1. 在導覽窗格中，選擇**主題**。

1. 選擇在步驟 1 中建立的主題，然後選擇**編輯**。

1. 展開 **Access policy (存取政策)**。

1. 將以下 `Sid` 區塊新增至現有的政策。將每個*範例資源預留位置*取代為您自己的資訊。

   ```
   {
         "Sid": "Allow OpsCenter to publish to this topic",
         "Effect": "Allow",
         "Principal": {
           "Service": "ssm.amazonaws.com"
         },
         "Action": "SNS:Publish",
         "Resource": "arn:aws:sns:region:account ID:topic name", // Account ID of the SNS topic owner
         "Condition": {
         "StringEquals": {
           "AWS:SourceAccount": "account ID" //  Account ID of the OpsItem owner
         }
      }
   }
   ```
**注意**  
`aws:SourceAccount` 全域條件金鑰可防止混淆代理人情境。若要使用此條件金鑰，請將值設定為相應 OpsItem 擁有者的帳戶 ID。如需詳細資訊，請參閱《IAM 使用者指南》**中的[混淆代理](https://docs.aws.amazon.com//IAM/latest/UserGuide/confused-deputy.html)一節。

1. 選擇**儲存變更**。

現在，建立或更新 OpsItems 時，系統會傳送通知給 Amazon SNS 主題。

**重要**  
如果您在步驟 2 中使用 AWS Key Management Service (AWS KMS) 伺服器端加密金鑰設定 Amazon SNS 主題，請完成步驟 3。否則，可以略過步驟 3。

## 步驟 3：更新 AWS KMS 存取政策
<a name="OpsCenter-getting-started-sns-KMS-policy"></a>

如果您開啟 Amazon SNS 主題的 AWS KMS 伺服器端加密，您還必須更新 AWS KMS key 設定主題時所選 的存取政策。使用下列程序更新存取政策，讓 Systems Manager 可以將 OpsItem 通知發佈至您在步驟 1 中建立的 Amazon SNS 主題。

**注意**  
OpsCenter 不支援將 OpsItems 發佈至以 AWS 受管金鑰設定的 Amazon SNS 主題。

1. 在 https：//[https://console.aws.amazon.com/kms](https://console.aws.amazon.com/kms) 開啟 AWS KMS 主控台。

1. 若要變更 AWS 區域，請使用頁面右上角的區域選擇器。

1. 在導覽窗格中，選擇 **Customer managed keys** (客戶受管金鑰)。

1. 選擇您在建立主題時所選擇 KMS 金鑰的 ID。

1. 在 **Key policy (金鑰政策)** 區段中，選擇 **Switch to policy view (切換至政策檢視)**。

1. 選擇**編輯**。

1. 將以下 `Sid` 區塊新增至現有的政策。將每個*範例資源預留位置*取代為您自己的資訊。

   ```
   {
         "Sid": "Allow OpsItems to decrypt the key",
         "Effect": "Allow",
         "Principal": {
           "Service": "ssm.amazonaws.com"
         },
         "Action": ["kms:Decrypt", "kms:GenerateDataKey*"],
          "Resource": "arn:aws:kms:region:account ID:key/key ID"
       }
   ```

    在以下範例中，第 14 行輸入新區塊。  
![\[編輯 Amazon SNS 主題的 AWS KMS 存取政策。\]](http://docs.aws.amazon.com/zh_tw/systems-manager/latest/userguide/images/OpsItems_SNS_KMS_access_policy.png)

1. 選擇**儲存變更**。

## 步驟 4：開啟預設 OpsItems 規則以傳送有關新 OpsItems 的通知
<a name="OpsCenter-getting-started-sns-default-rules"></a>

Amazon EventBridge 中的預設 OpsItems 規則未設定 Amazon Resource Name (ARN) 來傳送 Amazon SNS 通知。使用下列程序在 EventBridge 中編輯規則並輸入 `notifications` 區塊。

**將通知區塊新增至預設 OpsItem 規則**

1. 在 https：//[https://console.aws.amazon.com/systems-manager/](https://console.aws.amazon.com/systems-manager/) 開啟 AWS Systems Manager 主控台。

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

1. 選擇 **OpsItems** 索引標籤，然後選擇 **Configure sources (設定來源)**。

1. 選擇您要以 `notifications` 區塊設定的來源規則名稱，如下列範例所示。  
![\[選擇 Amazon EventBridge 規則來新增 Amazon SNS 通知區塊。\]](http://docs.aws.amazon.com/zh_tw/systems-manager/latest/userguide/images/OpsItems_SNS_Setup_2.png)

   規則在 Amazon EventBridge 中開啟。

1. 在規則詳細資訊頁面的 **Targets** (目標) 索引標籤上，選擇 **Edit** (編輯)。

1. 在 **Additional settings** (其他設定) 區段中，選擇 **Configure input transformer** (設定輸入轉換器)。

1. 在**範本**方塊中，以下列格式新增 `notifications` 區塊。

   ```
   "notifications":[{"arn":"arn:aws:sns:region:account ID:topic name"}],
   ```

   範例如下。

   ```
   "notifications":[{"arn":"arn:aws:sns:us-west-2:1234567890:MySNSTopic"}],
   ```

   輸入 `resources` 區塊前的通知區塊，如下列美國西部 (奧勒岡) (us-west-2) 區域範例所示。

   ```
   {
       "title": "EBS snapshot copy failed",
       "description": "CloudWatch Event Rule SSMOpsItems-EBS-snapshot-copy-failed was triggered. Your EBS snapshot copy has failed. See below for more details.",
       "category": "Availability",
       "severity": "2",
       "source": "EC2",
       "notifications": [{
           "arn": "arn:aws:sns:us-west-2:1234567890:MySNSTopic"
       }],
       "resources": <resources>,
       "operationalData": {
           "/aws/dedup": {
               "type": "SearchableString",
               "value": "{\"dedupString\":\"SSMOpsItems-EBS-snapshot-copy-failed\"}"
           },
           "/aws/automations": {
               "value": "[ { \"automationType\": \"AWS:SSM:Automation\", \"automationId\": \"AWS-CopySnapshot\" } ]"
           },
           "failure-cause": {
               "value": <failure - cause>
           },
           "source": {
               "value": <source>
           },
           "start-time": {
               "value": <start - time>
           },
           "end-time": {
               "value": <end - time>
           }
       }
   }
   ```

1. 選擇**確認**。

1. 選擇**下一步**。

1. 選擇**下一步**。

1. 選擇**更新規則**。

系統下次為預設規則建立 OpsItem 時，就會將通知發佈至 Amazon SNS 主題。