

• 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)。

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

# 建立自訂服務角色以將診斷報告匯出到 S3
<a name="create-s3-export-role"></a>

在 Systems Manager 的**探索節點**頁面中檢視 AWS 組織或帳戶的已篩選或未篩選的受管節點清單時，可以將清單匯出為報告，以 `CSV` 檔案形式傳送至 Amazon S3 儲存貯體。

為此，您必須指定具有操作所需的必要許可和信任政策的服務角色。可以選擇讓 Systems Manager 在下載報告的過程中為您建立角色。也可以自行建立角色及其所需的政策。

**建立自訂服務角色以將診斷報告匯出到 S3**

1. 依照《IAM 使用者指南》**中的 [Creating policies using the JSON editor](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) 中的步驟。
   + 使用以下內容作為政策內容，並務必使用自己的資訊取代{{預留位置值}}。

------
#### [ JSON ]

****  

     ```
     {
       "Version":"2012-10-17",		 	 	 
       "Statement": [
         {
           "Effect": "Allow",
           "Action": [
             "s3:GetObject",
             "s3:PutObject"
           ],
           "Resource": "arn:aws:s3:::{{amzn-s3-demo-bucket}}/*",
           "Condition": {
             "StringEquals": {
               "aws:ResourceAccount": "{{111122223333}}"
             }
           }
         },
         {
           "Effect": "Allow",
           "Action": [
             "s3:GetBucketAcl",
             "s3:ListBucket",
             "s3:PutLifecycleConfiguration",
             "s3:GetLifecycleConfiguration"
           ],
           "Resource": "arn:aws:s3:::{{amzn-s3-demo-bucket}}",
           "Condition": {
             "StringEquals": {
               "aws:ResourceAccount": "{{111122223333}}"
             }
           }
         },
         {
           "Effect": "Allow",
           "Action": [
             "ssm:ListNodes"
           ],
           "Resource": "*"
         }
       ]
     }
     ```

------
   + 為政策命名，以協助您在下一個步驟中輕鬆識別該政策。

1. 依照《IAM 使用者指南》**中的 [Creating an IAM role using a custom trust policy (console)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-custom.html) 中的步驟。
   + 對於步驟 4，輸入下列信任政策，並務必使用自己的資訊取代{{預留位置值}}。

------
#### [ JSON ]

****  

     ```
     {
       "Version":"2012-10-17",		 	 	 
       "Statement": [
         {
           "Sid": "SSMAssumeRole",
           "Effect": "Allow",
           "Principal": {
             "Service": "ssm.amazonaws.com"
           },
           "Action": "sts:AssumeRole",
           "Condition": {
             "StringEquals": {
               "aws:SourceAccount": "{{111122223333}}"
             }
           }
         }
       ]
     }
     ```

------

1. 針對步驟 10，選擇**步驟 2：新增許可**，然後選取在上一步中建立的政策名稱。

建立角色之後，可以在依照[下載或匯出受管節點報告](explore-nodes-download-report.md)中的步驟操作時選取該角色。