ALIYUN::SLB::LoadBalancer is used to create a Server Load Balancer (SLB) instance.

Syntax

{
  "Type": "ALIYUN::SLB::LoadBalancer",
  "Properties": {
    "VpcId": String ,
    "SlaveZoneId": String ,
    "Bandwidth": Integer,
    "AddressType": String ,
    "VSwitchId": String ,
    "LoadBalancerName": String ,
    "InternetChargeType": String ,
    "MasterZoneId": String ,
    "Tags": List,
    "AutoPay": Boolean,
    "PayType": String ,
    "PricingCycle": String ,
    "Duration": Integer
  }
}

Properties

Name Type Required Editable Description Validity
VpcId String No No The ID of the VPC to which the SLB instance is connected. None
SlaveZoneId String No No The ID of the secondary zone to which the SLB instance belongs. None
Bandwidth Integer No No The peak bandwidth of the SLB instance if it is connected to the public network and billed by fixed bandwidth.

For instances that are connected to the public network and billed by bandwidth, this parameter is only valid when the Bandwidth parameter of the SLB listener is specified. For instances that are connected to the public network and billed by traffic, this parameter is not valid. To set the peak bandwidth of the instance, specify the Bandwidth parameter of the SLB listener.

Valid values: 1 to 1000. Unit: Mbit/s.

Default value: 1

VPC-connected instances are billed by traffic.

AddressType String No No The address type of the SLB instance.

Valid values: internet and intranet

Default value: internet

VSwitchId String No No The ID of the VSwitch that is connected to the VPC. None
LoadBalancerName String No No The name of the SLB instance to be created. The name must be 1 to 80 characters in length and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), and underscores (_). If this parameter is not specified, a default instance name is assigned by the system.
InternetChargeType String No No The billing method of the SLB instance if it is connected to the public network.

Valid values: paybybandwidth and paybytraffic

Default value: paybytraffic

MasterZoneId String No No The ID of the primary zone to which the created SLB instance will belong. None
Tags List No No The list of tags attached to the SLB instance. The tags are listed in JSON format. Each tag includes a TagKey and a TagValue. A maximum of five tags can be attached to an SLB instance.
LoadBalancerSpec String No No The specifications of the SLB instance.

Valid values:

  • slb.s1.small
  • slb.s2.small
  • slb.s2.medium
  • slb.s3.small
  • slb.s3.medium
  • slb.s3.large

The available specifications vary by region. For more information about the specifications, see Guaranteed-performance instances .

AutoPay Boolean No No Specifies whether to automatically pay the bill of the SLB instance if it is subscription-based and connected to the public network. Valid values: true and false. Default value: false.
Note This parameter is only valid on the China site (aliyun.com).
PayType String No No The billing method of the SLB instance. Valid values:
  • PayOnDemand
  • PrePay
PricingCycle String No No The billing period of the SLB instance if it is subscription-based and connected to the public network. Valid values: month and year
Note This parameter is only valid on the China site (aliyun.com).
Duration Integer No No The duration of the SLB instance if it is subscription-based and connected to the public network. Valid values:
  • 1 to 9 when the PricingCycle parameter is set to month
  • 1 to 3 when the PricingCycle parameter is set to year
Note This parameter is only valid on the China site (aliyun.com).

Tags syntax

"Tags": [
  {
    "Value": String ,
    "Key": String 
  }
]

Tags properties

Name Type Required Editable Description Validity
Key String Yes No None None
Value String No No None None

Response parameters

Fn::GetAtt

  • LoadBalancerId: the unique ID of the SLB instance.
  • NetworkType: the network type of the SLB instance, which can be vpc or classic.
  • AddressType: the address type of the SLB instance, which can be intranet or internet.
  • IpAddress: the IP address of the SLB instance.
  • OrderId: the order ID of the SLB instance.

Examples

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "CreateLoadBalance": {
      "Type": "ALIYUN::SLB::LoadBalancer",
      "Properties": {
        "LoadBalancerName": "createdByHeat",
        "AddressType": "internet",
        "InternetChargeType": "paybybandwidth",
      }
    }
  },
  "Outputs": {
    "LoadBalanceDetails": {
      "Value": {
        "Fn::GetAtt": ["CreateLoadBalance", "LoadBalancerId"]}
    }
  }
}