All Products
Search
Document Center

Resource Orchestration Service:Create ROS parameters with OOS Parameter Store

Last Updated:Aug 20, 2026

If you frequently use the same parameter values in your Resource Orchestration Service (ROS) templates, you can store them in Operation Orchestration Service (OOS) Parameter Store. You can then reference these parameters by name in your ROS templates.

Background

OOS Parameter Store lets you store values as either common parameters or encryption parameters. Key Management Service (KMS) encrypts the encryption parameters. This topic uses an example of creating an ECS instance group to show you how to create parameters in OOS Parameter Store and reference them in a ROS template. This example creates the following parameters:

Parameter

Parameter name

Category

Type

Value

ImageId

my_image

common parameter

String

centos_7_9_x64_20G_alibase_2020****.vhd

SecurityGroupIds

security_group_ids

common parameter

StringList

sg-group1,sg-group2

Password

Password

encryption parameter

String

MyPassword1

For more information about the parameters, see ALIYUN::ECS::InstanceGroup.

Note

You must create parameters in the same region as the stack that uses them. For example, if you plan to create a stack in the China (Hangzhou) region, you must also create the parameters in that region.

Step 1: Create parameters in the OOS console

  1. Log on to the OOS console.

  2. In the left-side navigation pane, click Parameter Store.

  3. In the region drop-down list in the top navigation bar, select the region where you want to create the parameters.

    Note

    The parameters must be in the same region as your stack. In this example, select China (Hangzhou).

  4. Create the my_image common parameter.

    1. On the Parameter Store page, click the Common Parameters tab, and then click Create Common Parameter.

    2. On the Create Common Parameter page, configure Parameter Name and Value, and select a Parameter Type.

      For this example, use the following settings:

      • Parameter Name: my_image.

      • Parameter Type: String.

      • Value: centos_7_9_x64_20G_alibase_2020****.vhd.

    3. Click Create.

      After the parameter is created, you can click its name on the Common Parameters tab and view its details, such as name, version, type, and value, on the Description tab.

  5. Create the security_group_ids common parameter.

    1. On the Parameter Store page, click the Common Parameters tab, and then click Create Common Parameter.

    2. On the Create Common Parameter page, configure Parameter Name and Value, and select a Parameter Type.

      For this example, use the following settings:

      • Parameter Name: security_group_ids.

      • Parameter Type: StringList.

      • Value: sg-group1,sg-group2.

    3. Click Create.

      After the parameter is created, you can click its name on the Common Parameters tab and view its details, such as name, version, type, and value, on the Description tab.

  6. Create the Password encryption parameter.

    1. On the Parameter Store page, click the Encryption Parameters tab, and then click Create Encryption Parameter.

    2. On the Create Encryption Parameter page, configure Parameter Name and Value, and select a KMS Key ID.

      For this example, use the following settings:

      • Parameter Name: Password.

      • KMS Key ID: Default Service CMK.

      • Value: MyPassword1.

    3. Click Create.

      After the parameter is created, you can click the parameter name on the Encryption Parameters tab. On the Description tab, click Show next to Value to view the value of the Password parameter.

Step 2: Write a ROS template

After you create the parameters, you can write a ROS template and reference the parameters in the Parameters or Resources section:

  • Reference parameters in the Parameters section

    Set the Type to ALIYUN::OOS::Parameter::Value for a common parameter or ALIYUN::OOS::SecretParameter::Value for an encryption parameter.

    For example, the following code defines a template parameter named ImageId that references the latest version of the my_image common parameter.

    Parameters:
      ImageId:
        Type: ALIYUN::OOS::Parameter::Value
        Default: my_image

    You can also reference a specific version, such as version 1, by setting the parameter to my_image:1.

  • Reference parameters in the Resources section

    You can reference a parameter in the Properties of a resource by using the following format: {{resolve:<parameter-type>:<parameter-name>:<version-number>}}.

    • parameter-type (Required)

      The type of the parameter. Valid values:

      • oos: a common parameter.

      • oos-secret: an encryption parameter.

    • parameter-name (Required)

      The name of the parameter.

    • version-number (Optional)

      The parameter version. If you do not specify this field, the latest version is used.

    For example, the following code shows how to reference the latest version of the my_image common parameter for the ImageId property and version 2 of the Password encryption parameter.

    Resources:
      ECS:
        Type: ALIYUN::ECS::Instance
        Properties:
          ImageId: '{{resolve:oos:my_image}}'
          Password: '{{resolve:oos-secret:Password:2}}'
          ...: null

You can use most intrinsic functions when you reference parameters in a template. For more information, see Functions. The following functions are not supported: Ref, Fn::GetAtt, Fn::GetStackOutput, and Fn::Calculate.

The following template is used in this example:

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  InstanceType:
    Type: String
    Default: ecs.c6.large
  ImageId:
    Type: ALIYUN::OOS::Parameter::Value
    Default: my_image
  Vpc:
    Type: String
  VSwitch:
    Type: String
Resources:
  ECS:
    Type: ALIYUN::ECS::InstanceGroup
    Properties:
      ImageId:
        Ref: ImageId
      InstanceType:
        Ref: InstanceType
      VpcId:
        Ref: Vpc
      VSwitchId:
        Ref: VSwitch
      SecurityGroupIds: '{{resolve:oos:security_group_ids:1}}'
      Password: '{{resolve:oos-secret:Password}}'
      MaxAmount: 1
Outputs:
  InstanceIds:
    Value:
      Fn::GetAtt:
        - ECS
        - InstanceIds

ROS automatically converts the data type of the referenced parameter based on its type in OOS. Parameter Store supports the String and StringList types. If you reference a parameter of the StringList type, ROS converts it to a List for use in the template. For example, the security_group_ids parameter is a StringList with a value of sg-group1,sg-group2. When you use this parameter to create an ALIYUN::ECS::InstanceGroup resource, ROS resolves the value to ["sg-group1", "sg-group2"].

Step 3: Create a stack in the ROS console

In the ROS console, use the sample template from Step 2 to create a stack that creates an ECS instance group. For detailed instructions, see Create a stack.

After the stack is created, you can verify that the parameters were referenced correctly. In the left-side navigation pane of the ROS console, click Stacks. On the Stacks page, find and click the name of your stack. On the stack details page, click the Parameters tab to view the parameters and their resolved values.