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,
"AddressIpVersion": String,
"ModificationProtectionConfig": Map,
"Tags": List,
"AccessLogConfig": Map,
"SecurityGroupIds": List
}
}
屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
AddressType | String | 是 | 否 | ALB實例的地址類型。 | 取值:
|
LoadBalancerBillingConfig | Map | 是 | 否 | 計費配置。 | 更多信息,請參見LoadBalancerBillingConfig屬性。 |
LoadBalancerEdition | String | 是 | 否 | ALB實例的版本。 | 取值:
|
LoadBalancerName | String | 是 | 是 | ALB實例的名稱。 | 長度為1~80個字符??砂⑽淖帜?、數字、短劃線(-)、正斜線(/)、半角句號(.)和下劃線(_)。 不指定該參數時,默認由系統分配一個實例名稱。 |
VpcId | String | 是 | 否 | 專有網絡ID。 | 無 |
ZoneMappings | List | 是 | 否 | 可用區及交換機映射列表。 | 您必須至少指定兩個可用區。更多信息,請參見ZoneMappings屬性。 |
AccessLogConfig | Map | 否 | 是 | 訪問日志配置。 | 更多信息,請參見AccessLogConfig屬性。 |
AddressAllocatedMode | String | 否 | 否 | 地址模式。 | 取值:
|
AddressIpVersion | String | 否 | 否 | 負載均衡實例的IP版本。 | 取值:
|
BandwidthPackageId | String | 否 | 是 | 綁定的共享帶寬包ID。 | 當AddressType取值為Internet時,該參數有效。 |
DeletionProtectionEnabled | Boolean | 否 | 是 | 是否啟用刪除保護。 | 取值:
|
ModificationProtectionConfig | Map | 否 | 是 | 修改保護的配置。 | 更多信息,請參見ModificationProtectionConfig屬性。 |
ResourceGroupId | String | 否 | 是 | 資源組ID。 | 無 |
Tags | List | 否 | 是 | ALB實例的標簽。 | 最多支持添加20個標簽。 更多信息,請參見Tags屬性。 |
SecurityGroupIds | List | 否 | 是 | 應用型負載均衡實例需要綁定的安全組 ID 集合。 | 無 |
AccessLogConfig語法
"AccessLogConfig": {
"Enable": Boolean,
"LogStore": String,
"LogProject": String
}
AccessLogConfig屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
LogProject | String | 是 | 否 | 日志項目。 | 無 |
LogStore | String | 是 | 否 | 日志存儲。 | 無 |
Enable | Boolean | 否 | 是 | 是否啟用訪問日志配置。 | 取值:
|
LoadBalancerBillingConfig語法
"LoadBalancerBillingConfig": {
"PayType": String
}
LoadBalancerBillingConfig屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
PayType | String | 是 | 否 | ALB實例的計費方式。 | 取值:PostPay,表示按量付費。 |
ZoneMappings語法
"ZoneMappings": [
{
"ZoneId": String,
"VSwitchId": String,
"AllocationId": String,
"LoadBalancerAddresses": List
}
]
ZoneMappings屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
VSwitchId | String | 是 | 否 | 交換機ID。 | 每個可用區只能包含一個交換機。 |
ZoneId | String | 是 | 否 | 可用區ID。 | 無 |
AllocationId | String | 否 | 否 | 與ALB實例關聯的EIP (elastic IP address) ID。 | 無 |
LoadBalancerAddresses | List | 否 | 否 | 實例地址。 | 更多信息,請參見LoadBalancerAddresses屬性。 |
LoadBalancerAddresses語法
"ModificationProtectionConfig": {
"AllocationId": String
}
LoadBalancerAddresses屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
AllocationId | String | 是 | 否 | 與ALB實例關聯的EIP (elastic IP address) 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個字符,不能以 |
Value | String | 否 | 否 | 標簽值。 | 長度為0~128個字符,不能以 |
返回值
Fn::GetAtt
LoadBalancerEdition:ALB實例的版本。
VpcId:專有網絡ID。
LoadBalancerId:ALB實例ID。
AddressType:ALB實例的地址類型。
DNSName:ALB實例的域名。
ZoneMappings:可用區及交換機映射列表。
示例
YAML
格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
VpcId:
Type: String
AssociationProperty: ALIYUN::ECS::VPC::VPCId
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****
Resources:
LoadBalancer:
Type: ALIYUN::ALB::LoadBalancer
Properties:
LoadBalancerName: TestLoadBalancer
LoadBalancerEdition: Basic
VpcId:
Ref: VpcId
LoadBalancerBillingConfig:
PayType: PostPay
ZoneMappings:
Ref: ZoneMappings
AddressType: Internet
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
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"VpcId": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
},
"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****"
}
]
}
},
"Resources": {
"LoadBalancer": {
"Type": "ALIYUN::ALB::LoadBalancer",
"Properties": {
"LoadBalancerName": "TestLoadBalancer",
"LoadBalancerEdition": "Basic",
"VpcId": {
"Ref": "VpcId"
},
"LoadBalancerBillingConfig": {
"PayType": "PostPay"
},
"ZoneMappings": {
"Ref": "ZoneMappings"
},
"AddressType": "Internet"
}
}
},
"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"
]
}
}
}
}