

• AWS Systems Manager CloudWatch 控制面板在 2026 年 4 月 30 日之后将不再可用。客户可以像现在一样继续使用 Amazon CloudWatch 控制台来查看、创建和管理其 Amazon CloudWatch 控制面板。有关更多信息，请参阅 [Amazon CloudWatch 控制面板文档](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html)。

# `aws:assertAwsResourceProperty` - 断言 AWS 资源状态或事件状态
<a name="automation-action-assertAwsResourceProperty"></a>

`aws:assertAwsResourceProperty` 操作可用于对特定自动化步骤的资源状态或事件状态进行断言。

**注意**  
`aws:assertAwsResourceProperty` 操作支持自动节流重试。有关更多信息，请参阅 [为节流的操作配置自动重试](automation-throttling-retry.md)。

有关如何使用此操作的更多示例，请参阅 [其他运行手册示例](automation-document-examples.md)。

**Input**  
由您选择的 API 操作定义的输入。

------
#### [ YAML ]

```
action: aws:assertAwsResourceProperty
inputs:
  Service: {{The official namespace of the service}}
  Api: {{The API operation or method name}}
  {{API operation inputs or parameters}}: {{A value}}
  PropertySelector: {{Response object}}
  DesiredValues:
  - {{Desired property values}}
```

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

```
{
  "action": "aws:assertAwsResourceProperty",
  "inputs": {
    "Service":"{{The official namespace of the service}}",
    "Api":"{{The API operation or method name}}",
    "{{API operation inputs or parameters}}":"{{A value}}",
    "PropertySelector": "{{Response object}}",
    "DesiredValues": [
      "{{Desired property values}}"
    ]
  }
}
```

------

服务  
包含要运行的 API 操作的 AWS 服务命名空间。例如，Systems Manager 的命名空间为 `ssm`。Amazon EC2 的命名空间为 `ec2`。您可以在《AWS CLI 命令参考》的[可用服务](https://docs.aws.amazon.com/cli/latest/reference/#available-services)部分查看支持的 AWS 服务命名空间列表。  
类型：字符串  
是否必需：是

API  
要运行的 API 操作的名称。您可以在以下[服务参考](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/index.html)页面的左侧导航栏中选择服务来查看 API 操作（也称为方法）。在要调用的服务的**客户端**部分中选择一种方法。例如，下面的 [Amazon RDS 方法](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html)页面中列出了 Amazon Relational Database Service (Amazon RDS) 的所有 API 操作（方法）。  
类型：字符串  
是否必需：是

API 操作输入  
一个或多个 API 操作输入。您可以在以下[服务参考](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/index.html)页面的左侧导航栏中选择服务来查看可用的输入（也称为参数）。在要调用的服务的**客户端**部分中选择一种方法。例如，下面的 [Amazon RDS 方法](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html)页面中列出了 Amazon RDS 的所有方法。选择 [describe\_db\_instances](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html#RDS.Client.describe_db_instances) 方法并向下滚动以查看可用的参数，例如 **DBInstanceIdentifier**、**Name** 和 **Values**。使用以下格式指定多个输入。  

```
inputs:
  Service: {{The official namespace of the service}}
  Api: {{The API operation name}}
  {{API input 1}}: {{A value}}
  {{API Input 2}}: {{A value}}
 {{ API Input 3}}: {{A value}}
```

```
"inputs":{
      "Service":"{{The official namespace of the service}}",
      "Api":"{{The API operation name}}",
      "{{API input 1}}":"{{A value}}",
      "{{API Input 2}}":"{{A value}}",
      "{{API Input 3}}":"{{A value}}"
}
```
类型：由选择的 API 操作决定  
是否必需：是

PropertySelector  
响应对象中特定属性的 JSONPath。您可以在以下[服务参考](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/index.html)页面的左侧导航栏中选择服务来查看响应对象。在要调用的服务的**客户端**部分中选择一种方法。例如，下面的 [Amazon RDS 方法](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html)页面中列出了 Amazon RDS 的所有方法：选择 [describe\_db\_instances](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html#RDS.Client.describe_db_instances) 方法，然后向下滚动到**响应结构**部分。**DBInstances** 被列为响应对象。  
类型：字符串  
是否必需：是

DesiredValues  
要继续自动化的预期状态。如果指定布尔值，则必须使用大写字母，例如 True 或 False。  
类型：StringList  
是否必需：是