ALIYUN::SLB::LoadBalancerClone类型用于克隆负载均衡实例。
语法
{
"Type": "ALIYUN::SLB::LoadBalancerClone",
"Properties": {
"Tags": List,
"ResourceGroupId": String,
"VSwitchId": String,
"LoadBalancerName": String,
"SourceLoadBalancerId": String,
"TagsPolicy": String,
"BackendServersPolicy": String,
"BackendServers": List
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
ResourceGroupId | String | 否 | 否 | 资源组ID。 | 无 |
VSwitchId | String | 否 | 否 | 交换机ID。 | 必须为源负载均衡实例所属专有网络下的交换机。不指定该参数时,将使用源负载均衡实例的交换机。 |
SourceLoadBalancerId | String | 是 | 否 | 将要克隆的负载均衡实例ID。 | 无 |
BackendServersPolicy | String | 否 | 否 | 克隆策略,指定配置新负载均衡实例需要监听的ECS实例以及各ECS实例的权重。 | 取值:
|
BackendServers | List | 否 | 是 | 指定新添加的需要监听的ECS实例列表。 | 详情请参见BackendServers属性。 |
LoadBalancerName | String | 否 | 否 | 负载均衡实例名称。 | 用户自定义字符串。长度为1~80个字符,可包含英文字母、数字、短划线(-)、正斜线(/)、英文句点(.)和下划线(_)。 |
Tags | List | 否 | 是 | SLB实例标签。 | 标签以键值对方式传入,最多可以设置5组标签。
详情请参见Tags属性。 |
TagsPolicy | String | 否 | 否 | 标签策略。 | 取值:
|
BackendServers语法
"BackendServers": [
{
"Type": String,
"ServerId": String,
"Description": String,
"ServerIp": String,
"Weight": Integer
}
]
BackendServers属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
ServerId | String | 是 | 是 | 后端服务器ID。 | 后端服务器(ECS实例)必须在运行中才可以加入负载均衡实例,每次调用最多可添加20个后端服务器。
只有性能保障型实例支持添加eni类型的后端服务器。 |
Weight | Integer | 是 | 是 | ECS实例在负载均衡实例中的权重。 | 取值范围:0~100。
默认值:100。 |
ServerIp | String | 否 | 否 | 后端服务器IP地址。 | 无 |
Type | String | 否 | 否 | 后端服务器类型。 | 取值:
|
Description | String | 否 | 是 | 后端服务器描述。 | 长度为1~80个字符,可包含英文字母、汉字、数字、短划线(-)、正斜线(/)、英文句点(.)和下划线(_)。 |
Tags语法
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
Key | String | 是 | 否 | 标签键 | 长度为1~128个字符,不能以aliyun 和acs: 开头,不能包含http:// 或者https:// 。
|
Value | String | 否 | 否 | 标签值 | 长度为0~128个字符,不能以aliyun 和acs: 开头,不能包含http:// 或者https:// 。
|
返回值
Fn::GetAtt
LoadBalancerId:新负载均衡实例的ID。
示例
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"LoadBalancerName": {
"Type": "String",
"Description": "Name of created load balancer. Length is limited to 1-80 characters, allowed to contain letters, numbers, '-, /, _,.' When not specified, a default name will be assigned."
},
"SourceLoadBalancerId": {
"Type": "String",
"Description": "Source load balancer id to clone"
},
"ResourceGroupId": {
"Type": "String",
"Description": "Resource group id."
},
"TagsPolicy": {
"Type": "String",
"Description": "Solution for handle the tags. If select 'clone', it will clone from source load balancer. If select 'empty' it will not coppy tags. If select 'append' it will append the new tags. If select 'replace' it will add new tags.\nDefault is 'empty'. ",
"AllowedValues": [
"clone",
"empty",
"append",
"replace"
],
"Default": "empty"
},
"VSwitchId": {
"Type": "String",
"Description": "The new VSwitch ID to create load balancer instance. For VPC network only and the VSwitch should belong to the VPC which source load balancer is located.When not specified, source load balancer VSwitch ID will be used."
},
"BackendServers": {
"Type": "Json",
"Description": "The list of ECS instance, which will attached to load balancer."
},
"Tags": {
"Type": "Json",
"Description": "Tags to attach to slb. Max support 5 tags to add during create slb. Each tag with two properties Key and Value, and Key is required.",
"MaxLength": 5
},
"BackendServersPolicy": {
"Type": "String",
"Description": "Solution for handle the backend server and weights. If select 'clone', it will clone from source load balancer. If select 'empty' it will not attach any backend servers. If select 'append' it will append the new backend server list to source backed servers. If select 'replace' it will only attach new backend server list. Default is 'clone'. ",
"AllowedValues": [
"clone",
"empty",
"append",
"replace"
],
"Default": "clone"
}
},
"Resources": {
"LoadBalancerClone": {
"Type": "ALIYUN::SLB::LoadBalancerClone",
"Properties": {
"LoadBalancerName": {
"Ref": "LoadBalancerName"
},
"SourceLoadBalancerId": {
"Ref": "SourceLoadBalancerId"
},
"ResourceGroupId": {
"Ref": "ResourceGroupId"
},
"TagsPolicy": {
"Ref": "TagsPolicy"
},
"VSwitchId": {
"Ref": "VSwitchId"
},
"BackendServers": {
"Ref": "BackendServers"
},
"Tags": {
"Ref": "Tags"
},
"BackendServersPolicy": {
"Ref": "BackendServersPolicy"
}
}
}
},
"Outputs": {
"LoadBalancerId": {
"Description": "The id of load balance generated",
"Value": {
"Fn::GetAtt": [
"LoadBalancerClone",
"LoadBalancerId"
]
}
}
}
}
YAML
格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
LoadBalancerName:
Type: String
Description: >-
Name of created load balancer. Length is limited to 1-80 characters,
allowed to contain letters, numbers, '-, /, _,.' When not specified, a
default name will be assigned.
SourceLoadBalancerId:
Type: String
Description: Source load balancer id to clone
ResourceGroupId:
Type: String
Description: Resource group id.
TagsPolicy:
Type: String
Description: >-
Solution for handle the tags. If select 'clone', it will clone from source
load balancer. If select 'empty' it will not coppy tags. If select
'append' it will append the new tags. If select 'replace' it will add new
tags.
Default is 'empty'.
AllowedValues:
- clone
- empty
- append
- replace
Default: empty
VSwitchId:
Type: String
Description: >-
The new VSwitch ID to create load balancer instance. For VPC network only
and the VSwitch should belong to the VPC which source load balancer is
located.When not specified, source load balancer VSwitch ID will be used.
BackendServers:
Type: Json
Description: 'The list of ECS instance, which will attached to load balancer.'
Tags:
Type: Json
Description: >-
Tags to attach to slb. Max support 5 tags to add during create slb. Each
tag with two properties Key and Value, and Key is required.
MaxLength: 5
BackendServersPolicy:
Type: String
Description: >-
Solution for handle the backend server and weights. If select 'clone', it
will clone from source load balancer. If select 'empty' it will not attach
any backend servers. If select 'append' it will append the new backend
server list to source backed servers. If select 'replace' it will only
attach new backend server list. Default is 'clone'.
AllowedValues:
- clone
- empty
- append
- replace
Default: clone
Resources:
LoadBalancerClone:
Type: 'ALIYUN::SLB::LoadBalancerClone'
Properties:
LoadBalancerName:
Ref: LoadBalancerName
SourceLoadBalancerId:
Ref: SourceLoadBalancerId
ResourceGroupId:
Ref: ResourceGroupId
TagsPolicy:
Ref: TagsPolicy
VSwitchId:
Ref: VSwitchId
BackendServers:
Ref: BackendServers
Tags:
Ref: Tags
BackendServersPolicy:
Ref: BackendServersPolicy
Outputs:
LoadBalancerId:
Description: The id of load balance generated
Value:
'Fn::GetAtt':
- LoadBalancerClone
- LoadBalancerId