ALIYUN::ALB::LoadBalancer类型用于创建应用型负载均衡ALB实例。
语法
{
"Type": "ALIYUN::ALB::LoadBalancer",
"Properties": {
"BandwidthPackageId": String,
"LoadBalancerName": String,
"LoadBalancerEdition": String,
"VpcId": String,
"ResourceGroupId": String,
"LoadBalancerBillingConfig": Map,
"AddressType": String,
"AddressAllocatedMode": String,
"ZoneMappings": List,
"DeletionProtectionEnabled": Boolean,
"ModificationProtectionConfig": Map,
"Tags": List
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
LoadBalancerName | String | 是 | 是 | ALB实例的名称。 | 长度为1~80个字符。可包含英文字母、数字、短划线(-)、正斜线(/)、半角句号(.)和下划线(_)。
不指定该参数时,默认由系统分配一个实例名称。 |
BandwidthPackageId | String | 否 | 是 | 绑定的共享带宽包ID。 | 当AddressType取值为Internet时该参数有效。 |
LoadBalancerEdition | String | 是 | 否 | ALB实例的版本。 | 取值:
|
VpcId | String | 是 | 否 | 专有网络ID。 | 无 |
ResourceGroupId | String | 否 | 是 | 资源组ID。 | 无 |
LoadBalancerBillingConfig | Map | 是 | 否 | 计费配置。 | 更多信息,请参见LoadBalancerBillingConfig属性。 |
AddressType | String | 是 | 否 | ALB实例的地址类型。 | 取值:
|
AddressAllocatedMode | String | 否 | 否 | 地址模式。 | 取值:
|
ZoneMappings | List | 是 | 否 | 可用区及交换机映射列表。 | 您必须至少指定两个可用区。更多信息,请参见ZoneMappings属性。 |
DeletionProtectionEnabled | Boolean | 否 | 是 | 是否启用删除保护。 | 取值:
|
ModificationProtectionConfig | Map | 否 | 是 | 修改保护的配置。 | 更多信息,请参见ModificationProtectionConfig属性。 |
Tags | List | 否 | 是 | ALB实例的标签。 | 最多支持添加20个标签。
更多信息,请参见Tags属性。 |
LoadBalancerBillingConfig语法
"LoadBalancerBillingConfig": {
"PayType": String
}
LoadBalancerBillingConfig属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
PayType | String | 是 | 否 | ALB实例的计费方式。 | 取值:PostPay,表示按量付费。 |
ZoneMappings语法
"ZoneMappings": [
{
"ZoneId": String,
"VSwitchId": String
}
]
ZoneMappings属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
ZoneId | String | 是 | 否 | 可用区ID。 | 无 |
VSwitchId | String | 是 | 否 | 交换机ID。 | 每个可用区只能包含一个交换机。 |
ModificationProtectionConfig语法
"ModificationProtectionConfig": {
"Status": String,
"Reason": String
}
ModificationProtectionConfig属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
Status | String | 是 | 是 | 修改保护的状态。 | 取值:
|
Reason | String | 否 | 是 | 修改保护的原因。 | 长度为2~128个字符,必须以英文字母或汉字开头,可包含英文字母、汉字、数字、半角句号(.)、下划线(_)和短划线(-)。
说明 当Status取值为ConsoleProtection时该参数有效。
|
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
- LoadBalancerEdition:ALB实例的版本。
- VpcId:专有网络ID。
- LoadBalancerId:ALB实例的ID。
- AddressType:ALB实例的地址类型。
- DNSName:ALB实例的域名。
- ZoneMappings:可用区及交换机映射列表。
示例
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"LoadBalancerName": {
"Type": "String",
"Description": "The name of the ALB instance.\nThe name must be 2 to 128 characters in length, and can contain letters, digits, periods(.), underscores (_), and hyphens (-). The name must start with a letter.",
"Default": "test_slb"
},
"LoadBalancerEdition": {
"Type": "String",
"Description": "The edition of the ALB instance. Different editions have different limits and billing methods. Valid values:\nBasic: Basic Edition\nStandard: Standard Edition",
"Default": "Basic"
},
"VpcId": {
"Type": "String",
"Description": "The ID of the virtual private cloud (VPC) where the ALB instance is deployed.",
"Default": "vpc-bp1bqklz6zm4fo4ir****"
},
"LoadBalancerBillingConfig": {
"Type": "Json",
"Description": "The configuration of the billing method.",
"Default": {
"PayType": "PostPay"
}
},
"ZoneMappings": {
"Type": "Json",
"Description": "The zones and the vSwitches in the zones. You must specify at least two zones.",
"Default": [
{
"ZoneId": "cn-hangzhou-h",
"VSwitchId": "vsw-bp1jhj254nwc7i0ge****"
},
{
"ZoneId": "cn-hangzhou-i",
"VSwitchId": "vsw-bp1llps83qqb30znp****"
}
]
},
"AddressType": {
"Type": "String",
"Description": "The type of IP address that the ALB instance uses to provide services. Valid values:\nInternet: The ALB instance uses a public IP address. The domain name of the ALB instance is resolved to the public IP address. Therefore, the ALB instance can be accessed over the Internet.\nIntranet: The ALB instance uses a private IP address. The domain name of the ALB instance is resolved to the private IP address. Therefore, the ALB instance can be accessed over the VPC where the ALB instance is deployed.",
"AllowedValues": [
"Internet",
"Intranet"
],
"Default": "Internet"
}
},
"Resources": {
"LoadBalancer": {
"Type": "ALIYUN::ALB::LoadBalancer",
"Properties": {
"LoadBalancerName": {
"Ref": "LoadBalancerName"
},
"LoadBalancerEdition": {
"Ref": "LoadBalancerEdition"
},
"VpcId": {
"Ref": "VpcId"
},
"LoadBalancerBillingConfig": {
"Ref": "LoadBalancerBillingConfig"
},
"ZoneMappings": {
"Ref": "ZoneMappings"
},
"AddressType": {
"Ref": "AddressType"
}
}
}
},
"Outputs": {
"LoadBalancerEdition": {
"Description": "The edition of the ALB instance.",
"Value": {
"Fn::GetAtt": [
"LoadBalancer",
"LoadBalancerEdition"
]
}
},
"VpcId": {
"Description": "The ID of the virtual private cloud (VPC) where the ALB instance is deployed.",
"Value": {
"Fn::GetAtt": [
"LoadBalancer",
"VpcId"
]
}
},
"LoadBalancerId": {
"Description": "The ID of the ALB instance.",
"Value": {
"Fn::GetAtt": [
"LoadBalancer",
"LoadBalancerId"
]
}
},
"AddressType": {
"Description": "The type of IP address that the ALB instance uses to provide services.",
"Value": {
"Fn::GetAtt": [
"LoadBalancer",
"AddressType"
]
}
},
"DNSName": {
"Description": "The domain name of the ALB instance.",
"Value": {
"Fn::GetAtt": [
"LoadBalancer",
"DNSName"
]
}
},
"ZoneMappings": {
"Description": "The zones, vSwitches and addresses which are mapped to the zones.",
"Value": {
"Fn::GetAtt": [
"LoadBalancer",
"ZoneMappings"
]
}
}
}
}