ALIYUN::ROS::WaitCondition类型用于创建处理UserData消息的实例。

语法

{
  "Type": "ALIYUN::ROS::WaitCondition",
  "Properties": {
    "Count": Number,
    "Handle": String,
    "Timeout": Number,
    "ShowProgressEvent": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
Handle String 引用ALIYUN::ROS::WaitConditionHandle创建的实例
Timeout Number 接收UserData消息的超时时间 取值范围:1~43,200。

单位:秒。

Count Number 接收UserData消息的总数
ShowProgressEvent String 是否显示接收UserData消息的进度事件 取值:
  • EnabledIfCreateStack:在创建资源栈时显示进度事件。
  • Disabled:不显示进度事件。

返回值

Fn::GetAtt

  • Data:JSON格式字符串,最近一次创建或更新后的信号数据。
  • JoinedErrorData:字符串,ErrorData信号内容的拼接。
  • ErrorData:JSON格式字符串,最近一次创建或更新后的错误信号数据。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ShowProgressEvent": {
      "Type": "String",
      "Description": "Whether to generate progress changed event. Default to Disabled.",
      "AllowedValues": [
        "EnabledIfCreateStack",
        "Disabled"
      ]
    },
    "Timeout": {
      "Type": "Number",
      "Description": "The number of seconds to wait for the correct number of signals to arrive.",
      "MinValue": 1,
      "MaxValue": 43200
    },
    "Count": {
      "Type": "Number",
      "Description": "The number of success signals that must be received before the stack creation process continues.",
      "Default": 1
    },
    "Handle": {
      "Type": "String",
      "Description": "A reference to the wait condition handle used to signal this wait condition."
    }
  },
  "Resources": {
    "WaitCondition": {
      "Type": "ALIYUN::ROS::WaitCondition",
      "Properties": {
        "ShowProgressEvent": {
          "Ref": "ShowProgressEvent"
        },
        "Timeout": {
          "Ref": "Timeout"
        },
        "Count": {
          "Ref": "Count"
        },
        "Handle": {
          "Ref": "Handle"
        }
      }
    }
  },
  "Outputs": {
    "LastErrorData": {
      "Description": "JSON serialized dict containing data associated with wait condition error signals sent to the handle backup by update last time.",
      "Value": {
        "Fn::GetAtt": [
          "WaitCondition",
          "LastErrorData"
        ]
      }
    },
    "JoinedLastErrorData": {
      "Description": "String containing data associated with wait condition error signals sent to the handle backup by update last time.",
      "Value": {
        "Fn::GetAtt": [
          "WaitCondition",
          "JoinedLastErrorData"
        ]
      }
    },
    "LastData": {
      "Description": "JSON serialized dict containing data associated with wait condition signals sent to the handle backup by update last time.",
      "Value": {
        "Fn::GetAtt": [
          "WaitCondition",
          "LastData"
        ]
      }
    },
    "JoinedErrorData": {
      "Description": "String containing data associated with wait condition error signals sent to the handle.",
      "Value": {
        "Fn::GetAtt": [
          "WaitCondition",
          "JoinedErrorData"
        ]
      }
    },
    "Data": {
      "Description": "JSON serialized dict containing data associated with wait condition signals sent to the handle.",
      "Value": {
        "Fn::GetAtt": [
          "WaitCondition",
          "Data"
        ]
      }
    },
    "ErrorData": {
      "Description": "JSON serialized dict containing data associated with wait condition error signals sent to the handle.",
      "Value": {
        "Fn::GetAtt": [
          "WaitCondition",
          "ErrorData"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Count:
    Default: 1
    Description: The number of success signals that must be received before the stack
      creation process continues.
    Type: Number
  Handle:
    Description: A reference to the wait condition handle used to signal this wait
      condition.
    Type: String
  ShowProgressEvent:
    AllowedValues:
    - EnabledIfCreateStack
    - Disabled
    Description: Whether to generate progress changed event. Default to Disabled.
    Type: String
  Timeout:
    Description: The number of seconds to wait for the correct number of signals to
      arrive.
    MaxValue: 43200
    MinValue: 1
    Type: Number
Resources:
  WaitCondition:
    Properties:
      Count:
        Ref: Count
      Handle:
        Ref: Handle
      ShowProgressEvent:
        Ref: ShowProgressEvent
      Timeout:
        Ref: Timeout
    Type: ALIYUN::ROS::WaitCondition
Outputs:
  Data:
    Description: JSON serialized dict containing data associated with wait condition
      signals sent to the handle.
    Value:
      Fn::GetAtt:
      - WaitCondition
      - Data
  ErrorData:
    Description: JSON serialized dict containing data associated with wait condition
      error signals sent to the handle.
    Value:
      Fn::GetAtt:
      - WaitCondition
      - ErrorData
  JoinedErrorData:
    Description: String containing data associated with wait condition error signals
      sent to the handle.
    Value:
      Fn::GetAtt:
      - WaitCondition
      - JoinedErrorData
  JoinedLastErrorData:
    Description: String containing data associated with wait condition error signals
      sent to the handle backup by update last time.
    Value:
      Fn::GetAtt:
      - WaitCondition
      - JoinedLastErrorData
  LastData:
    Description: JSON serialized dict containing data associated with wait condition
      signals sent to the handle backup by update last time.
    Value:
      Fn::GetAtt:
      - WaitCondition
      - LastData
  LastErrorData:
    Description: JSON serialized dict containing data associated with wait condition
      error signals sent to the handle backup by update last time.
    Value:
      Fn::GetAtt:
      - WaitCondition
      - LastErrorData