文法
{
"Type": "ALIYUN::SLB::BackendServerToVServerGroupAddition",
"Properties": {
"BackendServers": List,
"VServerGroupId": String
}
}
屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
VServerGroupId | String | 是 | 否 | 伺服器組ID。 | 無 |
BackendServers | List | 是 | 是 | 伺服器列表。 | 更多資訊,請參見BackendServers屬性。 |
BackendServers文法
"BackendServers": [
{
"ServerId": String,
"Port": Integer,
"Weight": Integer,
"Type": String,
"Description": String,
"ServerIp": String
}
]
BackendServers屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
ServerId | String | 是 | 是 | 後端伺服器的執行個體ID。 | 無 |
Port | Integer | 是 | 是 | 後端伺服器使用的連接埠。 | 取值範圍:1~65,535。 |
Weight | Integer | 否 | 是 | 後端伺服器的權重。 | 取值範圍:0~100。 |
Type | String | 否 | 是 | 後端伺服器類型。 | 取值: ecs(預設值):ECS執行個體。 eni:彈性網卡執行個體。
說明 只有效能保障型執行個體支援添加ENI類型的後端伺服器。
|
Description | String | 否 | 是 | 後端伺服器描述。 | 長度為1~80個字元,可包含英文字母、漢字、數字、短劃線(-)、正斜線(/)、半形句號(.)和底線(_)。 |
ServerIp | String | 否 | 是 | 後端伺服器的IP地址。 | ECS或者ENI的執行個體IP地址。 |
傳回值
Fn::GetAtt
VServerGroupId:伺服器組的ID。
樣本
YAML格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
VServerGroupId:
Type: String
Description: The ID of virtual server group.
Default: rsp-wz9j5sanme***
BackendServers:
Type: Json
Description: The list of a combination of ECS Instance-Port-Weight.Same ecs instance with different port is allowed, but same ecs instance with same port isn't.
Default:
- Type: ecs
ServerId: i-wz9c46a4ejwyj*****
Port: 80
Weight: 100
Resources:
BackendServerToVServerGroupAddition:
Type: ALIYUN::SLB::BackendServerToVServerGroupAddition
Properties:
VServerGroupId:
Ref: VServerGroupId
BackendServers:
Ref: BackendServers
Outputs:
VServerGroupId:
Description: The ID of virtual server group.
Value:
Fn::GetAtt:
- BackendServerToVServerGroupAddition
- VServerGroupId
JSON格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"VServerGroupId": {
"Type": "String",
"Description": "The ID of virtual server group.",
"Default": "rsp-wz9j5sanme***"
},
"BackendServers": {
"Type": "Json",
"Description": "The list of a combination of ECS Instance-Port-Weight.Same ecs instance with different port is allowed, but same ecs instance with same port isn't.",
"Default": [
{
"Type": "ecs",
"ServerId": "i-wz9c46a4ejwyj*****",
"Port": 80,
"Weight": 100
}
]
}
},
"Resources": {
"BackendServerToVServerGroupAddition": {
"Type": "ALIYUN::SLB::BackendServerToVServerGroupAddition",
"Properties": {
"VServerGroupId": {
"Ref": "VServerGroupId"
},
"BackendServers": {
"Ref": "BackendServers"
}
}
}
},
"Outputs": {
"VServerGroupId": {
"Description": "The ID of virtual server group.",
"Value": {
"Fn::GetAtt": [
"BackendServerToVServerGroupAddition",
"VServerGroupId"
]
}
}
}
}
更多樣本,請參見建立負載平衡監聽、複製Server Load Balancer執行個體、上傳認證、建立擴充網域名稱、建立伺服器組並添加後端伺服器到Server Load Balancer執行個體、為HTTP或HTTPS監聽添加轉寄規則和將後端伺服器添加到伺服器組的組合樣本:JSON樣本和YAML樣本。