All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ROS::WaitCondition

Last Updated:Jun 15, 2026

ALIYUN::ROS::WaitCondition waits for signals and works with ALIYUN::ROS::WaitConditionHandle to control the execution flow of a stack. For example, when you create an Elastic Compute Service (ECS) instance, a signal is sent during user data execution.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

Handle

String

Yes

No

The reference to an ALIYUN::ROS::WaitConditionHandle instance.

None.

Timeout

Number

Yes

No

The timeout period for receiving UserData messages.

Valid values: 1 to 43200.

Unit: seconds.

Count

Number

No

Yes

The total number of UserData messages that Resource Orchestration Service (ROS) must receive.

None.

ShowProgressEvent

String

No

No

Specifies whether to display progress events for receiving UserData messages.

Valid values:

  • Disabled (default): does not display progress events.

  • Enabled: displays progress events.

  • EnabledIfCreateStack (not recommended): displays progress events only during stack creation.

Return values

Fn::GetAtt

  • Data: the JSON string of the most recently created or updated signal data.

  • JoinedErrorData: a string of the ErrorData content.

  • ErrorData: the JSON string of the most recently created or updated error signal data.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Description: ''
    Parameters: {}
    Outputs: {}
    Resources:
      InstallNginx:
        Type: 'ALIYUN::ECS::RunCommand'
        Properties:
          Type: RunShellScript
          CommandContent:
            'Fn::Replace':
              - ros-notify:
                  'Fn::GetAtt':
                    - InstallNginxWaitConditionHandle
                    - CurlCli
              - |
                #!/bin/sh
                yum install -y nginx
                systemctl restart nginx
                if [[ $? -eq 0 ]];
                then
                ros-notify -d "{\"status\" : \"SUCCESS\"}"
                else
                ros-notify -d "{\"status\" : \"FAILURE\"}"
                fi
          Name: InstallNginxScript
          InstanceIds:
            - i-wz995r4yn8njthoq****
          Timeout: 60
      InstallNginxWaitConditionHandle:
        Type: 'ALIYUN::ROS::WaitConditionHandle'
      InstallNginxWaitCondition:
        Type: 'ALIYUN::ROS::WaitCondition'
        Properties:
          Handle:
            Ref: InstallNginxWaitConditionHandle
          Timeout: 60
    Metadata: {}
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Description": "",
      "Parameters": {},
      "Outputs": {},
      "Resources": {
        "InstallNginx": {
          "Type": "ALIYUN::ECS::RunCommand",
          "Properties": {
            "Type": "RunShellScript",
            "CommandContent": {
              "Fn::Replace": [
                {
                  "ros-notify": {
                    "Fn::GetAtt": [
                      "InstallNginxWaitConditionHandle",
                      "CurlCli"
                    ]
                  }
                },
                "#!/bin/sh\nyum install -y nginx\nsystemctl restart nginx\nif [[ $? -eq 0 ]];\nthen \nros-notify -d \"{\\\"status\\\" : \\\"SUCCESS\\\"}\" \nelse \nros-notify -d \"{\\\"status\\\" : \\\"FAILURE\\\"}\" \nfi \n"
              ]
            },
            "Name": "InstallNginxScript",
            "InstanceIds": [
              "i-wz995r4yn8njthoq****"
            ],
            "Timeout": 60
          }
        },
        "InstallNginxWaitConditionHandle": {
          "Type": "ALIYUN::ROS::WaitConditionHandle"
        },
        "InstallNginxWaitCondition": {
          "Type": "ALIYUN::ROS::WaitCondition",
          "Properties": {
            "Handle": {
              "Ref": "InstallNginxWaitConditionHandle"
            },
            "Timeout": 60
          }
        }
      },
      "Metadata": {}
    }