All Products
Search
Document Center

Resource Orchestration Service:Pseudo parameters

Last Updated:Jul 29, 2024

Pseudo parameters are fixed parameters provided by the orchestration engine of Resource Orchestration Service (ROS). You can reference pseudo parameters in the same manner as you reference custom parameters. The values of the pseudo parameters are determined when ROS is running.

Pseudo parameters

ROS provides the following pseudo parameters:

  • ALIYUN::StackName: the name of a stack.

  • ALIYUN::StackId: the ID of the stack.

  • ALIYUN::Region: the region where the stack resides.

  • ALIYUN::AccountId: the ID of the executor account.

  • ALIYUN::TenantId: the ID of the Alibaba Cloud account.

  • ALIYUN::ResourceGroupId: the resource group to which the stack belongs.

  • ALIYUN::NoValue: If you use ALIYUN::NoValue for an optional property when you create or update a stack, the property will be deleted. If you use ALIYUN::NoValue for a required property when you create or update a stack, the default value of the property varies based on the data type. For example, if the property is of the String type, the value will be an empty string. If the property is of the Integer type, the value will be 0. If the property is of the Array type, the value will be an empty array.

  • ALIYUN::Index: a special pseudo parameter that can be used only in Count. For more information about Count, see Count.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  EnvType:
    Default: pre
    Type: String
Conditions:
  CreateDisk:
    Fn::Equals:
    - prod
    - Ref: EnvType
Resources:
  WebServer:
    Type: ALIYUN::ECS::Instance
    Properties:
      DiskMappings:
        Fn::If:
        - CreateDisk
        - - Category: cloud_efficiency
            DiskName: FirstDataDiskName
            Size: 40
          - Category: cloud_ssd
            DiskName: SecondDataDiskName
            Size: 40
        - Ref: ALIYUN::NoValue
      VpcId: vpc-m5eebunc50zfbmts7****
      SystemDiskCategory: cloud_efficiency
      SecurityGroupId: sg-m5eagh7rzys2z8sa****
      SystemDiskSize: 40
      ImageId: cent****
      IoOptimized: optimized
      VSwitchId: vsw-m5eem62p9729y6gps****
      InstanceType: ecs.c5.large
Outputs:
  StackName:
    Value:
      Ref: ALIYUN::StackName
  StackId:
    Value:
      Ref: ALIYUN::StackId
  Region:
    Value:
      Ref: ALIYUN::Region
  UserID:
    Value:
      Ref: ALIYUN::AccountId

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "EnvType": {
      "Default": "pre",
      "Type": "String"
    }
  },
  "Conditions": {
    "CreateDisk": {
      "Fn::Equals": [
        "prod",
        {
          "Ref": "EnvType"
        }
      ]
    }
  },
  "Resources": {
    "WebServer": {
      "Type": "ALIYUN::ECS::Instance",
      "Properties": {
        "DiskMappings": {
          "Fn::If": [
            "CreateDisk",
            [
              {
                "Category": "cloud_efficiency",
                "DiskName": "FirstDataDiskName",
                "Size": 40
              },
              {
                "Category": "cloud_ssd",
                "DiskName": "SecondDataDiskName",
                "Size": 40
              }
            ],
            {
              "Ref": "ALIYUN::NoValue"
            }
          ]
        },
        "VpcId": "vpc-m5eebunc50zfbmts7****",
        "SystemDiskCategory": "cloud_efficiency",
        "SecurityGroupId": "sg-m5eagh7rzys2z8sa****",
        "SystemDiskSize": 40,
        "ImageId": "cent****",
        "IoOptimized": "optimized",
        "VSwitchId": "vsw-m5eem62p9729y6gps****",
        "InstanceType": "ecs.c5.large"
      }
    }
  },
  "Outputs": {
    "StackName": {
      "Value": {
        "Ref": "ALIYUN::StackName"
      }
    },
    "StackId": {
      "Value": {
        "Ref": "ALIYUN::StackId"
      }
    },
    "Region": {
      "Value": {
        "Ref": "ALIYUN::Region"
      }
    },
    "UserID": {
      "Value": {
        "Ref": "ALIYUN::AccountId"
      }
    }
  }
}