All Products
Search
Document Center

CloudOps Orchestration Service:Template parameters

Last Updated:Jun 10, 2026

Use the Parameters field to make templates flexible and reusable.

Define parameters

Define parameters in the Parameters field of a template. Each parameter supports a name, description, type, default value, and verification rules.

Syntax

Parameters:
  parameter-name-1: # The name of the parameter. The name can contain letters, digits, backslashes (\), underscores (_), and hyphens (-). Spaces are not allowed. We recommend that you use the lower camel case for a parameter name. Example: instanceId. 
    Type: String # Optional. The type of the parameter. Valid values: List, Number, String, Boolean, and Json. Default value: String.
    Description: description # Optional. The description of the parameter, such as the usage of the parameter.
    AssociationProperty: DateTime # Optional. The property of a parameter. This facilitates parameter setting when you use the template to create an execution. After you specify a property for a parameter, you can specify the parameter in the CloudOps Orchestration Service (OOS) console more easily than entering the value in a text box. For example, you can select a value from a drop-down list, specify time on a tab, or enter commands in a code editor. If you want a parameter to specify the type of Elastic Compute Service (ECS) instances, you can specify ALIYUN::ECS::Instance::InstanceType for the AssociationProperty parameter. Then, when you specify the parameter-name-1 parameter, a drop-down list with all available instance types is provided for you to select. If you want the parameter to specify shell commands, you can specify the Code property for the AssociationProperty parameter. Then, a code editor is provided for you to enter commands. This is more user-friendly than entering commands in a small input box. The following properties are available: ALIYUN::ECS::Instance::InstanceType, ALIYUN::ECS::SecurityGroup::SecurityGroupId, ALIYUN::VPC::VSwitch::VSwitchId, ALIYUN::ECS::Image::ImageId, Targets, RateControl, Code, DateTime, Cron, and TimeZone. You can also use the AssociationPropertyMetadata parameter to define a parameter property in a fine-grained manner. For example, if you specify the DateTime property for the AssociationProperty parameter, you can set the time format of the parameter value by using the AssociationPropertyMetadata parameter. 
    AssociationPropertyMetadata:
      Format: 'YYYY-MM-DDThh:mm:ssZ'   # The fine-grained definition of the property that you specify by using the AssociationProperty parameter. The AssociationPropertyMetadata parameter determines how the value of the parameter-name-1 parameter is displayed. For example, if you set the Format parameter to YYYY-MM-DDThh:mm:ssZ, you can specify the date and time on a tab. If you set the Format parameter to hh:mm:ssZ, you can specify only the time on a tab. 
    Default: default-value # Optional. The default value of the parameter.
    AllowedValues: # Optional. Valid values of the parameter. 
      - value1
      - value2
    AllowedPattern: regular-expression # Optional. The regular expression that the parameter value must match. This attribute is valid only if the parameter value is of the String type.
    MinLength: 1 # Optional. The minimum length of the parameter value. This parameter is valid only if the parameter value is of the String type.
    MaxLength: 10 # Optional. The maximum length of the parameter value. This parameter is valid only if the parameter value is of the String type.
{
  "Parameters": {
    "parameter-name-1": {
      "Type": "String",
      "Description": "description",
      "AssociationProperty": "DateTime",
      "AssociationPropertyMetadata": {
        "Format": "YYYY-MM-DDThh:mm:ssZ"
      },
      "Default": "default-value",
      "AllowedValues": [
        "value1",
        "value2"
      ],
      "AllowedPattern": "regular-expression",
      "MinLength": 1,
      "MaxLength": 10
    }
  }
}

Reference parameters

Reference defined parameters in the Tasks field with the following syntax:

"some text {{ parameter_name }} some text {{parameter_name_2}} ..."                

Example:

In YAML format, enclose referenced parameters in double quotation marks ("").

"{{ parameter-name }}" # Reference a parameter itself.
"this is the {{ parameter-name }}" # Reference a parameter in a fixed string.
"hello {{parameter-last-name}} {{ parameter-first-name }}" # Reference multiple parameters in a fixed string.

Pseudo parameters

OOS provides built-in pseudo parameters that return execution information without requiring definition. To request additional pseudo parameters, submit a ticket with your scenario.

Parameter

Type

Description

Example

ACS::TemplateName

String

The template name used for the execution.

test

ACS::ExecutionId

String

The execution ID.

exec-2123445567

ACS::RegionId

String

The region of the execution.

cn-hangzhou

ACS::AccountId

String

The Alibaba Cloud account of the execution.

1234567890****

ACS::TaskLoopItem

String

The current item in a loop task iteration.

i-bpzxcvb1234****

ACS::OOSUtilVersion

String

The OOS proxy version.

1.01

ACS::CurrentDate

String

The current UTC date.

2020-12-29T

ACS::CurrentUTCTime

String

The current UTC time.

2020-12-29T10:00:30Z

ACS::ExecuteUser

String

The name of the Resource Access Management (RAM) user that triggers the execution.

zhangsan

ACS::ExecuteUserType

String

The RAM entity type that triggers the execution.

RamRole, RamUser or AlibabaCloudAccount