aws:assertAwsResourceProperty - 断言 Amazon 资源状态或事件状态 - Amazon Systems Manager
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

aws:assertAwsResourceProperty - 断言 Amazon 资源状态或事件状态

aws:assertAwsResourceProperty 操作可用于对特定自动化步骤的资源状态或事件状态进行断言。例如,您可以指定某个自动化步骤必须等待 Amazon Elastic Compute Cloud (Amazon EC2) 实例启动。然后它会调用具有 DesiredValue 属性 running 的 Amazon EC2 DescribeInstanceStatus API 操作。这可确保自动化等待一个正在运行的实例,并在实例确实正在运行时继续。

有关如何使用此操作的更多示例,请参阅 其他运行手册示例

输入

由您选择的 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 操作的 Amazon Web Service命名空间。例如,Systems Manager 的命名空间为 ssm。Amazon EC2 的命名空间为 ec2。您可以在《Amazon CLI 命令参考》的可用服务部分查看支持的 Amazon Web Service命名空间列表。

类型:字符串

必需:是

API

要运行的 API 操作的名称。您可以在以下服务参考页面的左侧导航栏中选择服务来查看 API 操作(也称为方法)。在要调用的服务的客户端部分中选择一种方法。例如,下面的 Amazon RDS 方法页面中列出了 Amazon Relational Database Service (Amazon RDS) 的所有 API 操作(方法)。

类型:字符串

必需:是

API 操作输入

一个或多个 API 操作输入。您可以在以下服务参考页面的左侧导航栏中选择服务来查看可用的输入(也称为参数)。在要调用的服务的客户端部分中选择一种方法。例如,下面的 Amazon RDS 方法页面中列出了 Amazon RDS 的所有方法。选择 describe_db_instances 方法并向下滚动以查看可用的参数,例如 DBInstanceIdentifierNameValues。使用以下格式指定多个输入。

YAML
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
JSON
"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。您可以在以下服务参考页面的左侧导航栏中选择服务来查看响应对象。在要调用的服务的客户端部分中选择一种方法。例如,下面的 Amazon RDS 方法页面中列出了 Amazon RDS 的所有方法:选择 describe_db_instances 方法,然后向下滚动到响应结构部分。DBInstances 被列为响应对象。

类型:字符串

必需:是

DesiredValues

要继续自动化的预期状态。如果指定布尔值,则必须使用大写字母,例如 True 或 False。

类型:StringList

必需:是