ALIYUN::SLB::LoadBalancer is used to create a Server Load Balancer (SLB) instance.
Syntax
{
"Type": "ALIYUN::SLB::LoadBalancer",
"Properties": {
"DeletionProtection": Boolean,
"AddressType": String,
"Tags": List,
"InternetChargeType": String,
"Bandwidth": Integer,
"SlaveZoneId": String,
"ResourceGroupId": String,
"AutoPay": Boolean,
"VpcId": String,
"PricingCycle": String,
"LoadBalancerName": String,
"Duration": Number,
"VSwitchId": String,
"LoadBalancerSpec": String,
"MasterZoneId": String,
"PayType": String,
"ModificationProtectionReason": String,
"ModificationProtectionStatus": String,
"AddressIPVersion": String,
"AutoRenewPeriod": Integer,
"AutoRenew": Boolean
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
ResourceGroupId | String | No | No | The ID of the resource group. | None. |
DeletionProtection | Boolean | No | No | Specifies whether to enable deletion protection. | Default value: false. Valid values:
|
VpcId | String | No | No | The ID of the virtual private cloud (VPC). | None. |
SlaveZoneId | String | No | No | The zone ID of the SLB instance. | None. |
Bandwidth | Integer | No | No | The maximum bandwidth of the Internet-facing SLB instance that supports the pay-by-bandwidth metering method. |
Valid values: 1 to 10000. Unit: Mbit/s. Default value: 1. The maximum bandwidth of an internal-facing SLB instance is set by the system when you configure the pay-by-data-transfer metering method for the instance.
|
AddressType | String | No | No | The IP address type of the SLB instance. |
Default value: internet. Valid values:
|
VSwitchId | String | No | No | The ID of the vSwitch. | None. |
LoadBalancerName | String | No | Yes | The name of the SLB instance. | The name must be 1 to 80 characters in length, and can contain letters, digits, hyphens
(-), forward slashes (/), periods (.), and underscores (_).
If you do not specify this property, the system assigns a name as the value of this property. |
InternetChargeType | String | No | No | The metering method of the Internet-facing SLB instance. |
Default value: paybytraffic. Valid values:
|
MasterZoneId | String | No | No | The primary zone ID of the SLB instance. | None. |
Tags | List | No | Yes | The tags that you want to add to the SLB instance. | You can add up to five tags.
For more information, see Tags properties. |
LoadBalancerSpec | String | No | Yes | The specification of the SLB instance. | Default value: slb.s1.small. Valid values:
The specification of an SLB instance varies based on the region in which the SLB instance is deployed. For more information about each instance specification, see FAQ about high-performance SLB instances. |
PayType | String | No | No | The billing method of the SLB instance. | Valid values:
|
ModificationProtectionStatus | String | No | No | Specifies whether to enable the configuration read-only mode. | Default value: NonProtection. Valid values:
|
ModificationProtectionReason | String | No | No | The reason why you want to enable the configuration read-only mode. | The reason must be 1 to 80 characters in length, and can contain letters, digits, periods (.), and hyphens (-). |
AddressIPVersion | String | No | No | The version of the IP address. | Valid values:
|
AutoRenewPeriod | Integer | No | No | The auto-renewal cycle of the SLB instance. | This property only takes effect when the AutoRenew property is set to true.
|
AutoRenew | Boolean | No | No | Specifies whether to enable auto-renewal for the SLB instance. | Default value: false. Valid values:
|
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags property
Field | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
Key | String | Yes | No | The key of the tag. | The key must be 1 to 64 characters in length, and cannot contain http:// or https:// . It cannot start with acs: or aliyun .
|
Value | String | No | No | The value of the tag. | The value must be 0 to 128 characters in length, and cannot contain http:// or https:// . It cannot start with acs: or aliyun .
|
Return values
Fn::GetAtt
- LoadBalancerId: the ID of the SLB instance.
- NetworkType: the network type of the SLB instance.
- AddressType: the IP address type of the SLB instance.
- IpAddress: the IP address of the SLB instance.
- OrderId: the order ID.
- Bandwidth: the maximum bandwidth of the Internet-facing SLB instance.
- PayType: the billing method of the SLB instance.
- AddressIPVersion: the IP address version of the SLB instance.
- SlaveZoneId: the secondary zone ID of the SLB instance.
- MasterZoneId: the primary zone ID of the SLB instance.
- LoadBalancerName: the name of the SLB instance.
- ResourceGroupId: the ID of the resource group.
- LoadBalancerSpec: the specification of the SLB instance.
- VpcId: the VPC ID of the SLB instance.
- VSwitchId: the vSwitch ID of the SLB instance.
Examples
JSON
format
{
"Parameters": {
"AutoRenewPeriod": {
"Type": "Number",
"Description": "Automatic renewal cycle, which takes effect when AutoRenew is true, and is required:\nWhen PricingCycle = month, the value range is 1-9\nWhen PeriodUnit = year, the value range is 1-3",
"MinValue": 1,
"MaxValue": 9
},
"ResourceGroupId": {
"Type": "String",
"Description": "Resource group id."
},
"PricingCycle": {
"Type": "String",
"Description": "Optional. The duration of the Subscription-billed Internet instance to be created.\nValid values: month | year.",
"AllowedValues": [
"month",
"year",
"Month",
"Year"
]
},
"VSwitchId": {
"Type": "String",
"Description": "The VSwitch id to create load balancer instance. For VPC network only."
},
"AutoRenew": {
"Type": "Boolean",
"Description": "Indicates whether automatic renewal is enabled for the instance. Valid values:true: Automatic renewal is enabled.false: Automatic renewal is not enabled. You must renew the instance manually.Default value: false.",
"AllowedValues": [
"True",
"true",
"False",
"false"
]
},
"AddressIPVersion": {
"Type": "String",
"Description": "IP version, support 'ipv4' or 'ipv6'. If 'ipv6' is selected, please note that the zone and the specification are supported.",
"AllowedValues": [
"ipv4",
"ipv6"
]
},
"Duration": {
"Type": "Number",
"Description": "Optional. The subscription duration of a Subscription Internet instance.\nValid values:\nIf PricingCycle is month, the valid range is 1 to 9 or 12, 24, 36, 48, 60.\nIf PricingCycle is year, the value range is 1 to 5.",
"AllowedValues": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
12,
24,
36,
48,
60
]
},
"DeletionProtection": {
"Type": "Boolean",
"Description": "Whether to enable deletion protection.",
"AllowedValues": [
"True",
"true",
"False",
"false"
],
"Default": false
},
"AutoPay": {
"Type": "Boolean",
"Description": "Optional. Indicates whether to automatically pay the bill for the Subscription-billed Internet instance to be created.\nValid values: true | false (default value)",
"AllowedValues": [
"True",
"true",
"False",
"false"
],
"Default": false
},
"PayType": {
"Type": "String",
"Description": "Optional. The billing method of the instance to be created.\nValid value: PayOnDemand (Pay-As-You-Go) | PrePay (Subscription)",
"AllowedValues": [
"Subscription",
"PrePaid",
"PrePay",
"Prepaid",
"PayAsYouGo",
"PostPaid",
"PayOnDemand",
"Postpaid"
]
},
"SlaveZoneId": {
"Type": "String",
"Description": "The slave zone id to create load balancer instance."
},
"ModificationProtectionStatus": {
"Type": "String",
"Description": "NonProtection or empty: means no restriction on modification protection\nConsoleProtection: Modify instance protection status by console\nDefault value is empty.",
"AllowedValues": [
"NonProtection",
"ConsoleProtection"
]
},
"InternetChargeType": {
"Type": "String",
"Description": "Instance internet access charge type.Support 'paybybandwidth' and 'paybytraffic' only. Default is 'paybytraffic'. If load balancer is created in VPC, the charge type will be set as 'paybytraffic' by default.",
"AllowedValues": [
"paybytraffic",
"PayByTraffic",
"paybybandwidth",
"PayByBandwidth"
],
"Default": "paybytraffic"
},
"LoadBalancerSpec": {
"Type": "String",
"Description": "The specification of the Server Load Balancer instance. Allowed value: slb.s1.small|slb.s2.small|slb.s2.medium|slb.s3.small|slb.s3.medium|slb.s3.large|slb.s3.xlarge|slb.s3.xxlarge. Default value: slb.s1.small. The supported performance specification in each region is different, two specifications are supported in the US East 1 region. If the region does not support the performance-guaranteed instances, the value will not take effect."
},
"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."
},
"VpcId": {
"Type": "String",
"Description": "The VPC id to create load balancer instance. For VPC network only."
},
"Bandwidth": {
"Type": "Number",
"Description": "The bandwidth for network, unit in Mbps(Mega bit per second). Range is 1 to 1000, default is 1. If InternetChargeType is specified as \"paybytraffic\", this property will be ignore and please specify the \"Bandwidth\" in ALIYUN::SLB::Listener.",
"Default": 1
},
"ModificationProtectionReason": {
"Type": "String",
"Description": "Set the reason for modifying the protection status. The length is 1-80 English or Chinese characters, must start with upper and lower letters or Chinese, and can include numbers, periods (.), underscores (_) and dashes (-).\nOnly valid when ModificationProtectionStatus is ConsoleProtection.",
"MaxLength": 80
},
"AddressType": {
"Type": "String",
"Description": "Loader balancer address type. Support 'internet' and 'intranet' only, default is 'internet'.",
"AllowedValues": [
"internet",
"intranet"
],
"Default": "internet"
},
"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
},
"MasterZoneId": {
"Type": "String",
"Description": "The master zone id to create load balancer instance."
}
},
"ROSTemplateFormatVersion": "2015-09-01",
"Outputs": {
"ResourceGroupId": {
"Description": "Resource group id.",
"Value": {
"Fn::GetAtt": [
"LoadBalance",
"ResourceGroupId"
]
}
},
"AddressIPVersion": {
"Description": "IP version",
"Value": {
"Fn::GetAtt": [
"LoadBalance",
"AddressIPVersion"
]
}
},
"VSwitchId": {
"Description": "VSwitch id",
"Value": {
"Fn::GetAtt": [
"LoadBalance",
"VSwitchId"
]
}
},
"LoadBalancerId": {
"Description": "The id of load balance created.",
"Value": {
"Fn::GetAtt": [
"LoadBalance",
"LoadBalancerId"
]
}
},
"PayType": {
"Description": "The billing method of the instance to be created.",
"Value": {
"Fn::GetAtt": [
"LoadBalance",
"PayType"
]
}
},
"OrderId": {
"Description": "The order ID.",
"Value": {
"Fn::GetAtt": [
"LoadBalance",
"OrderId"
]
}
},
"SlaveZoneId": {
"Description": "The slave zone id to create load balancer instance.",
"Value": {
"Fn::GetAtt": [
"LoadBalance",
"SlaveZoneId"
]
}
},
"LoadBalancerSpec": {
"Description": "The specification of the Server Load Balancer instance",
"Value": {
"Fn::GetAtt": [
"LoadBalance",
"LoadBalancerSpec"
]
}
},
"LoadBalancerName": {
"Description": "Name of created load balancer.",
"Value": {
"Fn::GetAtt": [
"LoadBalance",
"LoadBalancerName"
]
}
},
"VpcId": {
"Description": "Vpc id",
"Value": {
"Fn::GetAtt": [
"LoadBalance",
"VpcId"
]
}
},
"NetworkType": {
"Description": "The network type of the load balancer. \"vpc\" or \"classic\" network.",
"Value": {
"Fn::GetAtt": [
"LoadBalance",
"NetworkType"
]
}
},
"Bandwidth": {
"Description": "The bandwidth for network",
"Value": {
"Fn::GetAtt": [
"LoadBalance",
"Bandwidth"
]
}
},
"IpAddress": {
"Description": "The ip address of the load balancer.",
"Value": {
"Fn::GetAtt": [
"LoadBalance",
"IpAddress"
]
}
},
"AddressType": {
"Description": "The address type of the load balancer. \"intranet\" or \"internet\".",
"Value": {
"Fn::GetAtt": [
"LoadBalance",
"AddressType"
]
}
},
"MasterZoneId": {
"Description": "The master zone id to create load balancer instance.",
"Value": {
"Fn::GetAtt": [
"LoadBalance",
"MasterZoneId"
]
}
}
},
"Resources": {
"LoadBalance": {
"Type": "ALIYUN::SLB::LoadBalancer",
"Properties": {
"AutoRenewPeriod": {
"Ref": "AutoRenewPeriod"
},
"ResourceGroupId": {
"Ref": "ResourceGroupId"
},
"PricingCycle": {
"Ref": "PricingCycle"
},
"VSwitchId": {
"Ref": "VSwitchId"
},
"AutoRenew": {
"Ref": "AutoRenew"
},
"AddressIPVersion": {
"Ref": "AddressIPVersion"
},
"Duration": {
"Ref": "Duration"
},
"DeletionProtection": {
"Ref": "DeletionProtection"
},
"AutoPay": {
"Ref": "AutoPay"
},
"PayType": {
"Ref": "PayType"
},
"SlaveZoneId": {
"Ref": "SlaveZoneId"
},
"ModificationProtectionStatus": {
"Ref": "ModificationProtectionStatus"
},
"InternetChargeType": {
"Ref": "InternetChargeType"
},
"LoadBalancerSpec": {
"Ref": "LoadBalancerSpec"
},
"LoadBalancerName": {
"Ref": "LoadBalancerName"
},
"VpcId": {
"Ref": "VpcId"
},
"Bandwidth": {
"Ref": "Bandwidth"
},
"ModificationProtectionReason": {
"Ref": "ModificationProtectionReason"
},
"AddressType": {
"Ref": "AddressType"
},
"Tags": {
"Ref": "Tags"
},
"MasterZoneId": {
"Ref": "MasterZoneId"
}
}
}
}
}
YAML
format
Parameters:
AutoRenewPeriod:
Type: Number
Description: >-
Automatic renewal cycle, which takes effect when AutoRenew is true, and is
required:
When PricingCycle = month, the value range is 1-9
When PeriodUnit = year, the value range is 1-3
MinValue: 1
MaxValue: 9
ResourceGroupId:
Type: String
Description: Resource group id.
PricingCycle:
Type: String
Description: >-
Optional. The duration of the Subscription-billed Internet instance to be
created.
Valid values: month | year.
AllowedValues:
- month
- year
- Month
- Year
VSwitchId:
Type: String
Description: The VSwitch id to create load balancer instance. For VPC network only.
AutoRenew:
Type: Boolean
Description: >-
Indicates whether automatic renewal is enabled for the instance. Valid
values:true: Automatic renewal is enabled.false: Automatic renewal is not
enabled. You must renew the instance manually.Default value: false.
AllowedValues:
- 'True'
- 'true'
- 'False'
- 'false'
AddressIPVersion:
Type: String
Description: >-
IP version, support 'ipv4' or 'ipv6'. If 'ipv6' is selected, please note
that the zone and the specification are supported.
AllowedValues:
- ipv4
- ipv6
Duration:
Type: Number
Description: |-
Optional. The subscription duration of a Subscription Internet instance.
Valid values:
If PricingCycle is month, the valid range is 1 to 9 or 12, 24, 36, 48, 60.
If PricingCycle is year, the value range is 1 to 5.
AllowedValues:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 12
- 24
- 36
- 48
- 60
DeletionProtection:
Type: Boolean
Description: Whether to enable deletion protection.
AllowedValues:
- 'True'
- 'true'
- 'False'
- 'false'
Default: false
AutoPay:
Type: Boolean
Description: >-
Optional. Indicates whether to automatically pay the bill for the
Subscription-billed Internet instance to be created.
Valid values: true | false (default value)
AllowedValues:
- 'True'
- 'true'
- 'False'
- 'false'
Default: false
PayType:
Type: String
Description: |-
Optional. The billing method of the instance to be created.
Valid value: PayOnDemand (Pay-As-You-Go) | PrePay (Subscription)
AllowedValues:
- Subscription
- PrePaid
- PrePay
- Prepaid
- PayAsYouGo
- PostPaid
- PayOnDemand
- Postpaid
SlaveZoneId:
Type: String
Description: The slave zone id to create load balancer instance.
ModificationProtectionStatus:
Type: String
Description: |-
NonProtection or empty: means no restriction on modification protection
ConsoleProtection: Modify instance protection status by console
Default value is empty.
AllowedValues:
- NonProtection
- ConsoleProtection
InternetChargeType:
Type: String
Description: >-
Instance internet access charge type.Support 'paybybandwidth' and
'paybytraffic' only. Default is 'paybytraffic'. If load balancer is
created in VPC, the charge type will be set as 'paybytraffic' by default.
AllowedValues:
- paybytraffic
- PayByTraffic
- paybybandwidth
- PayByBandwidth
Default: paybytraffic
LoadBalancerSpec:
Type: String
Description: >-
The specification of the Server Load Balancer instance. Allowed value:
slb.s1.small|slb.s2.small|slb.s2.medium|slb.s3.small|slb.s3.medium|slb.s3.large|slb.s3.xlarge|slb.s3.xxlarge.
Default value: slb.s1.small. The supported performance specification in
each region is different, two specifications are supported in the US East
1 region. If the region does not support the performance-guaranteed
instances, the value will not take effect.
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.
VpcId:
Type: String
Description: The VPC id to create load balancer instance. For VPC network only.
Bandwidth:
Type: Number
Description: >-
The bandwidth for network, unit in Mbps(Mega bit per second). Range is 1
to 1000, default is 1. If InternetChargeType is specified as
"paybytraffic", this property will be ignore and please specify the
"Bandwidth" in ALIYUN::SLB::Listener.
Default: 1
ModificationProtectionReason:
Type: String
Description: >-
Set the reason for modifying the protection status. The length is 1-80
English or Chinese characters, must start with upper and lower letters or
Chinese, and can include numbers, periods (.), underscores (_) and dashes
(-).
Only valid when ModificationProtectionStatus is ConsoleProtection.
MaxLength: 80
AddressType:
Type: String
Description: >-
Loader balancer address type. Support 'internet' and 'intranet' only,
default is 'internet'.
AllowedValues:
- internet
- intranet
Default: internet
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
MasterZoneId:
Type: String
Description: The master zone id to create load balancer instance.
ROSTemplateFormatVersion: '2015-09-01'
Outputs:
ResourceGroupId:
Description: Resource group id.
Value:
'Fn::GetAtt':
- LoadBalance
- ResourceGroupId
AddressIPVersion:
Description: IP version
Value:
'Fn::GetAtt':
- LoadBalance
- AddressIPVersion
VSwitchId:
Description: VSwitch id
Value:
'Fn::GetAtt':
- LoadBalance
- VSwitchId
LoadBalancerId:
Description: The id of load balance created.
Value:
'Fn::GetAtt':
- LoadBalance
- LoadBalancerId
PayType:
Description: The billing method of the instance to be created.
Value:
'Fn::GetAtt':
- LoadBalance
- PayType
OrderId:
Description: The order ID.
Value:
'Fn::GetAtt':
- LoadBalance
- OrderId
SlaveZoneId:
Description: The slave zone id to create load balancer instance.
Value:
'Fn::GetAtt':
- LoadBalance
- SlaveZoneId
LoadBalancerSpec:
Description: The specification of the Server Load Balancer instance
Value:
'Fn::GetAtt':
- LoadBalance
- LoadBalancerSpec
LoadBalancerName:
Description: Name of created load balancer.
Value:
'Fn::GetAtt':
- LoadBalance
- LoadBalancerName
VpcId:
Description: Vpc id
Value:
'Fn::GetAtt':
- LoadBalance
- VpcId
NetworkType:
Description: The network type of the load balancer. "vpc" or "classic" network.
Value:
'Fn::GetAtt':
- LoadBalance
- NetworkType
Bandwidth:
Description: The bandwidth for network
Value:
'Fn::GetAtt':
- LoadBalance
- Bandwidth
IpAddress:
Description: The ip address of the load balancer.
Value:
'Fn::GetAtt':
- LoadBalance
- IpAddress
AddressType:
Description: The address type of the load balancer. "intranet" or "internet".
Value:
'Fn::GetAtt':
- LoadBalance
- AddressType
MasterZoneId:
Description: The master zone id to create load balancer instance.
Value:
'Fn::GetAtt':
- LoadBalance
- MasterZoneId
Resources:
LoadBalance:
Type: 'ALIYUN::SLB::LoadBalancer'
Properties:
AutoRenewPeriod:
Ref: AutoRenewPeriod
ResourceGroupId:
Ref: ResourceGroupId
PricingCycle:
Ref: PricingCycle
VSwitchId:
Ref: VSwitchId
AutoRenew:
Ref: AutoRenew
AddressIPVersion:
Ref: AddressIPVersion
Duration:
Ref: Duration
DeletionProtection:
Ref: DeletionProtection
AutoPay:
Ref: AutoPay
PayType:
Ref: PayType
SlaveZoneId:
Ref: SlaveZoneId
ModificationProtectionStatus:
Ref: ModificationProtectionStatus
InternetChargeType:
Ref: InternetChargeType
LoadBalancerSpec:
Ref: LoadBalancerSpec
LoadBalancerName:
Ref: LoadBalancerName
VpcId:
Ref: VpcId
Bandwidth:
Ref: Bandwidth
ModificationProtectionReason:
Ref: ModificationProtectionReason
AddressType:
Ref: AddressType
Tags:
Ref: Tags
MasterZoneId:
Ref: MasterZoneId
To view more examples, visit BackendServerAttachment.json and BackendServerAttachment.yml. In the examples, the ALIYUN::SLB::LoadBalancer, ALIYUN::SLB::MasterSlaveServerGroup, and ALIYUN::SLB::BackendServerAttachment resource types are involved.