

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

# 亚马逊 OpenSearch 服务
<a name="automation-ref-opensearch"></a>

 AWS Systems Manager 自动化为亚马逊 OpenSearch 服务提供了预定义的运行手册。有关运行手册的更多信息，请参阅[使用运行手册](https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-documents.html)。有关如何查看运行手册内容的信息，请参阅 [查看运行手册内容](automation-runbook-reference.md#view-automation-json)。

**Topics**
+ [`AWSConfigRemediation-DeleteOpenSearchDomain`](automation-aws-delete-opensearch-domain.md)
+ [`AWSConfigRemediation-EnforceHTTPSOnOpenSearchDomain`](automation-aws-enforce-https-opensearch.md)
+ [`AWSConfigRemediation-UpdateOpenSearchDomainSecurityGroups`](automation-aws-update-opensearch-security-group.md)
+ [`AWSSupport-TroubleshootOpenSearchRedYellowCluster`](automation-troubleshoot-opensearch-red-yellow-cluster.md)
+ [`AWSSupport-TroubleshootOpenSearchHighCPU`](automation-troubleshoot-opensearch-high-cpu.md)

# `AWSConfigRemediation-DeleteOpenSearchDomain`
<a name="automation-aws-delete-opensearch-domain"></a>

 **描述** 

 `AWSConfigRemediation-DeleteOpenSearchDomain`运行手册使用 [DeleteDomain](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/configuration-api.html#configuration-api-actions-deletedomain)API 删除给定的 Amazon OpenSearch 服务域。

 [运行此自动化（控制台）](https://console.aws.amazon.com/systems-manager/automation/execute/AWSConfigRemediation-DeleteOpenSearchDomain) 

**文档类型**

自动化

**所有者**

Amazon

**平台**

Linux、macOS、Windows

**参数**
+ DomainName

  类型：字符串

  允许的值：(\$1d\$112\$1/)?[a-z]\$11\$1[a-z0-9-]\$12,28\$1

  描述：（必填）您要删除的亚马逊 OpenSearch 服务域的名称。
+ AutomationAssumeRole

  类型：字符串

  描述：（必需）允许 Systems Manager Automation 代表您执行操作的 AWS Identity and Access Management (IAM) 角色的 Amazon 资源名称（ARN）。

**所需的 IAM 权限**

`AutomationAssumeRole` 参数需要执行以下操作才能成功使用运行手册。
+  `ssm:StartAutomationExecution` 
+  `ssm:GetAutomationExecution` 
+  `es:DeleteDomain` 
+  `es:DescribeDomain` 

 **文档步骤** 
+  `aws:executeScript`-接受 Amazon Serv OpenSearch ice 域名作为输入，将其删除，然后验证删除。

# `AWSConfigRemediation-EnforceHTTPSOnOpenSearchDomain`
<a name="automation-aws-enforce-https-opensearch"></a>

 **描述** 

 `AWSConfigRemediation-EnforceHTTPSOnOpenSearchDomain`运行手册使用 [UpdateDomainConfig](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/configuration-api.html#configuration-api-actions-updatedomainconfig)API `EnforceHTTPS` 在给定的亚马逊 OpenSearch 服务域上启用。

 [运行此自动化（控制台）](https://console.aws.amazon.com/systems-manager/automation/execute/AWSConfigRemediation-EnforceHTTPSOnOpenSearchDomain) 

**文档类型**

自动化

**所有者**

Amazon

**平台**

Linux、macOS、Windows

**参数**
+ DomainName

  类型：字符串

  允许的值：(\$1d\$112\$1/)?[a-z]\$11\$1[a-z0-9-]\$12,28\$1

  描述：（必填）您要用于强制执行 HTTPS 的亚马逊 OpenSearch 服务域的名称。
+ AutomationAssumeRole

  类型：字符串

  描述：（必需）允许 Systems Manager Automation 代表您执行操作的 AWS Identity and Access Management (IAM) 角色的 Amazon 资源名称（ARN）。

**所需的 IAM 权限**

`AutomationAssumeRole` 参数需要执行以下操作才能成功使用运行手册。
+  `ssm:StartAutomationExecution` 
+  `ssm:GetAutomationExecution` 
+  `es:DescribeDomain` 
+  `es:UpdateDomainConfig` 

 **文档步骤** 
+  `aws:executeScript`-在`DomainName`参数中指定的亚马逊 OpenSearch 服务域上启用`EnforceHTTPS`终端节点选项。

# `AWSConfigRemediation-UpdateOpenSearchDomainSecurityGroups`
<a name="automation-aws-update-opensearch-security-group"></a>

 **描述** 

 `AWSConfigRemediation-UpdateOpenSearchDomainSecurityGroups`运行手册使用 [UpdateDomainConfig](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/configuration-api.html#configuration-api-actions-updatedomainconfig)API 更新给定 Amazon OpenSearch 服务域上的安全组配置。

**注意**  
AWS 安全组只能应用于为亚马逊虚拟私有云 (VPC) Virtual Private Cloud 访问配置的亚马逊 OpenSearch 服务域，不能应用于配置为公共访问的 OpenSearch 亚马逊服务域。

 [运行此自动化（控制台）](https://console.aws.amazon.com/systems-manager/automation/execute/AWSConfigRemediation-UpdateOpenSearchDomainSecurityGroups) 

**文档类型**

自动化

**所有者**

Amazon

**平台**

Linux、macOS、Windows

**参数**
+ DomainName

  类型：字符串

  描述：（必填）您要用于更新安全组的 Amazon S OpenSearch ervice 域的名称。
+ SecurityGroupList

  类型： StringList

  描述：（必填）您要分配给 Amazon S OpenSearch ervice 域的安全组 IDs 。
+ AutomationAssumeRole

  类型：字符串

  描述：（必需）允许 Systems Manager Automation 代表您执行操作的 AWS Identity and Access Management (IAM) 角色的 Amazon 资源名称（ARN）。

**所需的 IAM 权限**

`AutomationAssumeRole` 参数需要执行以下操作才能成功使用运行手册。
+  `ssm:StartAutomationExecution` 
+  `ssm:GetAutomationExecution` 
+  `es:DescribeDomain` 
+  `es:UpdateDomainConfig` 

 **文档步骤** 
+  `aws:executeScript`-更新您在`DomainName`参数中指定的亚马逊 OpenSearch 服务域上的安全组配置。

# `AWSSupport-TroubleshootOpenSearchRedYellowCluster`
<a name="automation-troubleshoot-opensearch-red-yellow-cluster"></a>

 **描述** 

 `AWSSupport-TroubleshootOpenSearchRedYellowCluster`automation runbook 用于识别[红色](https://docs.aws.amazon.com//opensearch-service/latest/developerguide/handling-errors.html#handling-errors-red-cluster-status)或[黄色](https://docs.aws.amazon.com//opensearch-service/latest/developerguide/handling-errors.html#handling-errors-yellow-cluster-status)集群运行状况的原因，并指导您将集群更改回绿色。

 **如何工作？** 

 该运行手册`AWSSupport-TroubleshootOpenSearchRedYellowCluster`可帮助您排除红色或黄色群集的原因，并通过分析群集配置和资源利用率提供了解决此问题的后续步骤。

 运行手册执行以下步骤：
+  对目标域调用 [DescribeDomain](https://docs.aws.amazon.com//opensearch-service/latest/APIReference/API_DescribeDomain.html)API 以获取集群配置。
+  检查 OpenSearch 服务域是基于互联网（公共）还是基于[亚马逊虚拟私有云 (VPC) 的](https://docs.aws.amazon.com//opensearch-service/latest/developerguide/vpc.html)。
+  根据集群配置创建公共 AWS Lambda 函数或[基于 Amazon VPC](https://docs.aws.amazon.com//lambda/latest/dg/foundation-networking.html) 的函数。注意：Lambda 函数包含 APIs 对集群运行 OpenSearch 服务以确定集群为何处于红色或黄色状态的疑难解答代码。
+  删除 Lambda 函数。
+  显示已执行的检查以及解决红色或黄色群集问题的后续建议步骤。

**文档类型**

自动化

**所有者**

Amazon

**平台**

Linux、macOS、Windows

**参数**

**所需的 IAM 权限**

`AutomationAssumeRole` 参数需要执行以下操作才能成功使用运行手册。
+ `cloudformation:CreateStack`
+ `cloudformation:DescribeStacks`
+ `cloudformation:DescribeStackEvents`
+ `cloudformation:DeleteStack`
+ `lambda:CreateFunction`
+ `lambda:DeleteFunction`
+ `lambda:InvokeFunction`
+ `lambda:GetFunction`
+ `es:DescribeDomain`
+ `es:DescribeDomainConfig`
+ `ec2:DescribeSecurityGroups`
+ `ec2:DescribeSubnets`
+ `ec2:DescribeVpcs`
+ `ec2:DescribeNetworkInterfaces`
+ `ec2:CreateNetworkInterface`
+ `ec2:DeleteNetworkInterface`
+ `ec2:DescribeInstances`
+ `ec2:AttachNetworkInterface`
+ `cloudwatch:GetMetricData`
+ `iam:PassRole`

该`LambdaExecutionRole`参数需要以下操作才能成功使用运行手册：
+ `es:ESHttpGet`
+ `ec2:CreateNetworkInterface`
+ `ec2:DescribeNetworkInterfaces`
+ `ec2:DeleteNetworkInterface`

`LambdaExecutionRole`政策概述：

 以下是 Lambda 函数的执行角色（AWS Identity and Access Management (IAM) 角色）的示例，该角色向该函数授予访问本运行手册所需的 AWS 服务和资源的权限。有关更多信息，请参阅 [Lambda 执行角色](https://docs.aws.amazon.com//lambda/latest/dg/lambda-intro-execution-role.html)。

**注意**  
 只有当`ec2:DescribeNetworkInterfaces`您的 OpenSearch 服务集群[基于 Amazon VPC](https://docs.aws.amazon.com//opensearch-service/latest/developerguide/vpc.html) 时，才需要`ec2:CreateNetworkInterface`、和`ec2:DeleteNetworkInterface`，以允许 Lambda 函数创建和管理 Amazon VPC 网络接口。有关更多信息，请参阅[将出站联网连接到 Amazon VPC 和 [Lambda 执行](https://docs.aws.amazon.com//lambda/latest/dg/lambda-intro-execution-role.html)角色中的资源](https://docs.aws.amazon.com//lambda/latest/dg/configuration-vpc.html#vpc-permissions)。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "es:ESHttpGet",
            "Resource": [
                "arn:aws:es:us-east-1:111122223333:domain/domain-name/",
                "arn:aws:es:us-east-1:111122223333:domain/domain-name/_cluster/health",
                "arn:aws:es:us-east-1:111122223333:domain/domain-name/_cat/indices",
                "arn:aws:es:us-east-1:111122223333:domain/domain-name/_cat/allocation",
                "arn:aws:es:us-east-1:111122223333:domain/domain-name/_cluster/allocation/explain"
            ]
        },
        {
            "Condition": {
                "ArnLikeIfExists": {
                    "ec2:Vpc": "arn:aws:ec2:us-east-1:111122223333:vpc/vpc_id"
                }
            },
            "Action": [
                "ec2:DeleteNetworkInterface",
                "ec2:CreateNetworkInterface",
                "ec2:DescribeNetworkInterfaces",
                "ec2:UnassignPrivateIpAddresses",
                "ec2:AssignPrivateIpAddresses"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}
```

------

 **说明** 

按照这些步骤对自动化进行配置：

1. 在 AWS Systems Manager 控制台[AWSSupport-TroubleshootOpenSearchRedYellowCluster](https://console.aws.amazon.com/systems-manager/documents/AWSSupport-TroubleshootOpenSearchRedYellowCluster/description)中导航到。

1. 选择 Execute automation（执行自动化）。

1. 要输入参数，请输入以下内容：
   + **AutomationAssumeRole （可选）：**

     允许 Systems Manager Automation 代表您执行操作的 AWS Identity and Access Management (IAM) 角色的亚马逊资源名称 (ARN)。如果未指定角色，Systems Manager Automation 将使用启动此运行手册的用户的权限。
   + **LambdaExecutionRole （必填）：**

     Lambda 将用于签署对您的亚马逊服务集群的请求的 IAM 角色的 ARN。 OpenSearch 
   + **DomainName （必填）：**

     群集运行状况为红色或黄色的 OpenSearch 服务域的名称。
   + **UtilizationThreshold （可选）：**

     用于比较 CPUUtilization和 JVMMemory压力指标的利用率阈值百分比。默认值为 80。  
![\[Input parameters form for AWS Systems Manager Automation with IAM roles and domain settings.\]](http://docs.aws.amazon.com/zh_cn/systems-manager-automation-runbooks/latest/userguide/images/awssupport-troubleshoot-opensearch-red-yellow-cluster_input_paramters.png)

1. 如果您已在 S OpenSearch ervice 集群上启用了[精细访问控制](https://docs.aws.amazon.com//opensearch-service/latest/developerguide/fgac.html)，请确保将`LambdaExecutionRole`角色 arn 映射到至少具有权限的角色。`cluster_monitor`  
![\[集群 permissions section showing cluster_monitor permission granted.\]](http://docs.aws.amazon.com/zh_cn/systems-manager-automation-runbooks/latest/userguide/images/awssupport-troubleshoot-opensearch-red-yellow-cluster_permissions.png)  
![\[Backend roles interface showing an AWSIAM role for Lambda execution and options to remove or add roles.\]](http://docs.aws.amazon.com/zh_cn/systems-manager-automation-runbooks/latest/userguide/images/awssupport-troubleshoot-opensearch-red-yellow-cluster_backend_roles.png)

1. 选择执行。

1. 自动化启动。

1. 自动化运行手册执行以下步骤：
   + **GetClusterConfiguration:**

     获取 OpenSearch 服务集群配置。
   + **创建 AWSLambdaFunctionStack：**

     使用在您的账户中创建一个临时 Lambda 函数。 CloudFormation Lambda 函数用于运行服务。 OpenSearch APIs
   + **WaitForAWSLambdaFunctionStack:**

     等待 CloudFormation 堆栈完成。
   + **GetClusterMetricsFromCloudWatch:**

     获取与 Amazon CloudWatch ClusterStatus CPUUtilization、和 Pr JVMMemory ess OpenSearch ure Service 集群相关的指标及其创建日期。
   + **RunOpenSearchAPIs:**

     使用 Lambda 函数调用 OpenSearch 服务 APIs 并分析集群指标数据，以诊断红色或黄色集群状态的原因。
   + **删除 AWSLambdaFunctionStack：**

     删除您的账户中由此自动化创建的 Lambda 函数。

1. 完成后，查看“输出”部分以了解执行的详细结果。
   + **RootCause:**

     概述已确定的集群运行状况处于红色或黄色状态的原因。
   + **IssueDescription:**

     提供有关集群为何处于红色或黄色状态以及使集群恢复到绿色状态的可能步骤的详细信息。

 **参考** 

Systems Manager Automation
+ [运行此自动化（控制台）](https://console.aws.amazon.com/systems-manager/automation/execute/AWSSupport-TroubleshootOpenSearchRedYellowCluster)
+ [运行自动化](https://docs.aws.amazon.com//systems-manager/latest/userguide/automation-working-executing.html)
+ [设置自动化](https://docs.aws.amazon.com//systems-manager/latest/userguide/automation-setup.html)
+ [支持自动化工作流登录页面](https://aws.amazon.com/premiumsupport/technology/saw/)

AWS 服务文档
+ 有关更多信息，请参阅 [Amazon OpenSearch 服务疑难解答](https://docs.aws.amazon.com//opensearch-service/latest/developerguide/handling-errors.html)

# `AWSSupport-TroubleshootOpenSearchHighCPU`
<a name="automation-troubleshoot-opensearch-high-cpu"></a>

 **描述** 

 该`AWSSupport-TroubleshootOpenSearchHighCPU`运行手册提供了一种自动解决方案，用于从 Amazon S OpenSearch ervice 域收集诊断数据，以解决[高 CPU](https://repost.aws/knowledge-center/opensearch-troubleshoot-high-cpu) 问题。

 **如何工作？** 

 该`AWSSupport-TroubleshootOpenSearchHighCPU`运行手册有助于解决亚马逊 OpenSearch 服务域中 CPU 使用率过高的问题。

 运行手册执行以下步骤：
+  对提供的亚马逊 OpenSearch 服务域运行 [DescribeDomain](https://docs.aws.amazon.com//opensearch-service/latest/APIReference/API_DescribeDomain.html)API 以获取集群元数据。
+  检查亚马逊 OpenSearch 服务域是公共域还是基于 Amazon VPC 的域，并在的帮助下创建公共函数或基于 A [mazon V](https://docs.aws.amazon.com//opensearch-service/latest/developerguide/vpc.html) AWS Lambda PC 的 CloudFormation函数。
+  Lambda 函数从亚马逊 OpenSearch 服务域中获取诊断数据。
+  使用 AWS Step Functions 状态机协调多个 Lambda 函数执行，以收集更全面的数据。
+  默认情况下，将收集的数据存储在 Amazon CloudWatch 日志组中 24 小时。
+  删除已创建的资源，但 CloudWatch 日志组除外。

**文档类型**

自动化

**所有者**

Amazon

**平台**

Linux、macOS、Windows

**参数**

**所需的 IAM 权限**

`AutomationAssumeRole` 参数需要执行以下操作才能成功使用运行手册。
+ `cloudformation:CreateStack`
+ `cloudformation:CreateStack`
+ `cloudformation:DescribeStacks`
+ `cloudformation:DescribeStackEvents`
+ `cloudformation:DeleteStack`
+ `lambda:CreateFunction`
+ `lambda:DeleteFunction`
+ `lambda:InvokeFunction`
+ `lambda:GetFunction`
+ `lambda:TagResource`
+ `es:DescribeDomain`
+ `ec2:DescribeSecurityGroups`
+ `ec2:DescribeSubnets`
+ `ec2:DescribeVpcs`
+ `ec2:DescribeNetworkInterfaces`
+ `ec2:CreateNetworkInterface`
+ `ec2:DescribeInstances`
+ `ec2:AttachNetworkInterface`
+ `ec2:DeleteNetworkInterface`
+ `logs:CreateLogGroup`
+ `logs:PutRetentionPolicy`
+ `logs:TagResource`
+ `states:CreateStateMachine`
+ `states:DeleteStateMachine`
+ `states:StartExecution`
+ `states:TagResource`
+ `states:DescribeStateMachine`
+ `states:DescribeExecution`
+ `iam:PassRole`
+ `iam:CreateRole`
+ `iam:DeleteRole`
+ `iam:GetRole`
+ `iam:PutRolePolicy`
+ `iam:DeleteRolePolicy`
+ `ssm:DescribeAutomationExecutions`
+ `ssm:GetAutomationExecution`

**注意**  
 `iam:CreateRole`、、`iam:DeleteRole``iam:GetRole``iam:PutRolePolicy``iam:PutRolePolicy`、和仅`iam:DeleteRolePolicy`在您未使用现有 IAM 角色作为**LambdaInvocationRoleForStepFunctions**参数时才是必需的

该`LambdaExecutionRole`参数需要以下操作才能成功使用运行手册：
+ `es:ESHttpGet`
+ `ec2:CreateNetworkInterface`
+ `ec2:DescribeNetworkInterfaces`
+ `ec2:DeleteNetworkInterface`
+ `logs:CreateLogStream`
+ `logs:PutLogEvents`

Lambda 执行角色向该函数授予访问本运行手册所需的 AWS 服务和资源的权限。有关更多信息，请参阅 [Lambda 执行角色](https://docs.aws.amazon.com//lambda/latest/dg/lambda-intro-execution-role.html)。

**注意**  
 只有当`ec2:DescribeNetworkInterfaces`您的 OpenSearch 服务集群[基于 Amazon VPC](https://docs.aws.amazon.com//opensearch-service/latest/developerguide/vpc.html) 时，才需要`ec2:CreateNetworkInterface`、和`ec2:DeleteNetworkInterface`，以允许 Lambda 函数创建和管理 Amazon VPC 网络接口。有关更多信息，请参阅[将出站联网连接到 Amazon VPC 和 [Lambda 执行](https://docs.aws.amazon.com//lambda/latest/dg/lambda-intro-execution-role.html)角色中的资源](https://docs.aws.amazon.com//lambda/latest/dg/configuration-vpc.html#vpc-permissions)。

`LambdaInvocationRoleForStepFunctions`参数授予 AWS Step Functions 状态机调用 Lambda 函数的权限。以下是一个 IAM 策略示例，该策略授予 Step Functions 调用从服务域获取诊断数据的 Lambda 函数的 OpenSearch 权限。有关更多信息，请参阅 AWS Step Functions 开发人员指南中的[创建状态机 IAM 角色](https://docs.aws.amazon.com/step-functions/latest/dg/procedure-create-iam-role.html)。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "lambda:InvokeFunction",
            "Resource": [
                "arn:aws:lambda:us-east-1:111122223333:function:AWSSupport-HighCPU-*"
            ]
        }
    ]
}
```

------

 **说明** 

按照这些步骤对自动化进行配置：

1. 导航到 AWS Systems Manager 控制台[AWSSupport-TroubleshootOpenSearchHighCPU](https://console.aws.amazon.com/systems-manager/documents/AWSSupport-TroubleshootOpenSearchHighCPU/description)中的。

1. 选择 Execute automation（执行自动化）。

1. 要输入参数，请输入以下内容：
   + **AutomationAssumeRole （可选）：**

     允许 Systems Manager Automation 代表您执行操作的 AWS Identity and Access Management (IAM) 角色的亚马逊资源名称 (ARN)。如果未指定角色，Systems Manager Automation 将使用启动此运行手册的用户的权限。
   + **DomainName （必填）：**

     您要针对高 CPU 问题进行故障排除的 Amazon OpenSearch 服务域的名称。
   + **LambdaExecutionRoleForOpenSearch（必填）：**

     要附加到 Lambda 函数的 IAM 角色的 ARN。Lambda 函数使用此角色的证书签署对亚马逊 OpenSearch 服务域的请求。如果在 Amazon Ser OpenSearch vice 域上启用了精细访问控制，则必须将此角色映射到至少具有 “cluster\$1monitor” 权限的 OpenSearch 服务控制面板后端角色。
   + **LambdaInvocationRoleForStepFunctions（可选）：**

     （可选）要附加到 Step Functions 工作流程的 IAM 角色的 ARN。状态机使用此角色的证书来调用从服务域获取诊断数据的 Lambda 函数。 OpenSearch 如果未指定任何角色，则此自动化将在您的账户中为 Step Functions 创建一个 IAM 角色。
   + **DataRetentionDays （可选）：**

     保留从 Amazon OpenSearch 服务域收集的诊断数据的天数。默认情况下，数据保留 24 小时（一天）。您可以选择将数据最多保留 30 天。
   + **NumberOfDataSamples （可选）：**

     要从 Amazon OpenSearch 服务域中收集的数据样本数量。默认情况下，会收集 5 个数据样本。您最多可以收集 10 个样本，并且将为每个样本集合调用 Lambda 函数。

1. 如果您已在 S OpenSearch ervice 集群上启用了[精细访问控制](https://docs.aws.amazon.com//opensearch-service/latest/developerguide/fgac.html)，请确保将`LambdaExecutionRole`角色 arn 映射到至少具有权限的角色。`cluster_monitor`  
![\[集群 permissions section showing cluster_monitor permission granted.\]](http://docs.aws.amazon.com/zh_cn/systems-manager-automation-runbooks/latest/userguide/images/awssupport-troubleshoot-opensearch-high-cpu_cluster_permissions.png)  
![\[Backend roles interface showing an AWSIAM role for Lambda execution and options to remove or add roles.\]](http://docs.aws.amazon.com/zh_cn/systems-manager-automation-runbooks/latest/userguide/images/awssupport-troubleshoot-opensearch-high-cpu_backend_roles.png)

1. 选择执行。

1. 自动化启动。

1. 自动化运行手册执行以下步骤：
   + **检查并发性：**

     确保只有一次针对指定的 Amazon S OpenSearch ervice 域名执行此操作手册。如果 runbook 发现另一次针对相同域名的执行，则会返回错误并结束。
   + **getDomainConfig:**

     获取目标 OpenSearch 服务域的配置详细信息。
   + **配置资源：**

     使用配置用于数据收集的资源 CloudFormation。
   + **waitForStack创作：**

     等待 CloudFormation 堆栈完成。
   + **describeStackResources:**

     描述 CloudFormation 堆栈并获取状态机的 ARN。
   + **runStateMachine:**

     通过运行 Step Functions 状态机来调用数据收集器 Lambda 函数一次或多次。
   + **describeErrorsFromStackEvents:**

     描述 CloudFormation 堆栈中的错误是否存在错误。
   + **unstageOpenSearch高CPUAutomation：**

     删除`AWSSupport-TroubleshootOpenSearchHighCPU` CloudFormation 堆栈。
   + **describeErrorsFromStackDeletion:**

     描述删除 CloudFormation 堆栈时遇到的错误。
   + **最终状态：**

     返回`AWSSupport-TroubleshootOpenSearchHighCPU`运行手册的最终输出。

1. 完成后，查看“输出”部分以了解执行的详细结果。
   + **最终状态。 FinalOutput**:

     提供存储诊断数据的 CloudWatch 日志组。  
![\[Output message indicating hot thread data collection completed with log group details.\]](http://docs.aws.amazon.com/zh_cn/systems-manager-automation-runbooks/latest/userguide/images/awssupport-troubleshoot-opensearch-high-cpu_outputs.png)

 **参考** 

Systems Manager Automation
+ [运行此自动化（控制台）](https://console.aws.amazon.com/systems-manager/automation/execute/AWSSupport-TroubleshootOpenSearchHighCPU)
+ [运行自动化](https://docs.aws.amazon.com//systems-manager/latest/userguide/automation-working-executing.html)
+ [设置自动化](https://docs.aws.amazon.com//systems-manager/latest/userguide/automation-setup.html)
+ [支持自动化工作流登录页面](https://aws.amazon.com/premiumsupport/technology/saw/)

AWS 服务文档
+ 有关更多信息，请参阅 [Amazon OpenSearch 服务疑难解答](https://docs.aws.amazon.com//opensearch-service/latest/developerguide/handling-errors.html)