ALIYUN::ALB::BackendServerAttachment类型用于向服务器组中添加后端服务器。
语法
{
"Type": "ALIYUN::ALB::BackendServerAttachment",
"Properties": {
"ServerGroupId": String,
"Servers": List
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
ServerGroupId | String | 是 | 否 | 服务器组ID。 | 无 |
Servers | List | 是 | 是 | 后端服务器列表。 | 最多支持指定40个服务器。 更多信息,请参见Servers属性。 |
Servers语法
"Servers": [
{
"ServerType": String,
"Description": String,
"ServerId": String,
"ServerIp": String,
"Port": Integer,
"Weight": Integer
}
]
Servers属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
ServerType | String | 是 | 是 | 后端服务器类型。 | 取值:
|
Description | String | 否 | 是 | 后端服务器描述。 | 长度为2~256个字符。 |
ServerId | String | 是 | 是 | 资源ID或IP地址。 | 取值:
|
ServerIp | String | 否 | 是 | ENI多IP模式时指定的IP地址。 | 无 |
Port | Integer | 否 | 是 | 后端服务器使用的端口。 | 取值范围:1~65,535。 |
Weight | Integer | 否 | 是 | 后端服务器的权重。 | 取值范围:0~100。 默认值:100。 说明 取值为0时,不会将请求转发给后端服务器。 |
返回值
Fn::GetAtt
ServerGroupId:服务器组ID。
示例
JSON
格式{ "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { "ServerGroupId": { "Type": "String", "Description": "The ID of the server group.", "Default": "sgp-46ndzg2wz4v5mp1****" } }, "Resources": { "BackendServerAttachment": { "Type": "ALIYUN::ALB::BackendServerAttachment", "Properties": { "ServerGroupId": { "Ref": "ServerGroupId" }, "Servers": [ { "Description": "test", "Port": 80, "ServerId": "ecs-bp67acfmxazb4p****", "ServerIp": "192.168.1.1", "ServerType": "Ecs", "Weight": 100 } ] } } }, "Outputs": { "ServerGroupId": { "Description": "The ID of the server group.", "Value": { "Fn::GetAtt": [ "BackendServerAttachment", "ServerGroupId" ] } } } }