Pseudo parameters are fixed parameters provided by the orchestration engine of Resource Orchestration Service (ROS). They can be referenced like user-defined parameters, and their values are determined while ROS is running.
ROS provides the following pseudo parameters:
ALIYUN::StackName
: the name of the stack.ALIYUN::StackId
: the ID of the stack.ALIYUN::Region
: the region where the stack resides.ALIYUN::AccountId
: the account ID of the stack.ALIYUN::TenantId
: the Alibaba Cloud account ID of the stack.ALIYUN::NoValue
: If you useALIYUN::NoValue
for an optional property when you create or update a stack, the property will be deleted. If you useALIYUN::NoValue
for a required property, the default value of the property depends on its data type. For example, if the property is of the String type, its value will be an empty string. If the property is of the Integer type, its value will be 0. If the property is of the Array type, its value will be an empty array.ALIYUN::Index
: a special pseudo parameter that can only be used in theCount
parameter. For more information aboutCount
, see Count.
Examples
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"
}
}
}
}
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