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,
    "VpcId": String,
    "LoadBalancerName": String,
    "VSwitchId": String,
    "LoadBalancerSpec": String,
    "MasterZoneId": String,
    "PayType": String,
    "ModificationProtectionReason": String,
    "ModificationProtectionStatus": String,
    "AddressIPVersion": String,
    "AutoRenew": Boolean,
    "InstanceChargeType": String
  }
}

Properties

Property Type Required Editable Description Constraint
ResourceGroupId String No Yes The ID of the resource group. None
DeletionProtection Boolean No Yes Specifies whether to enable deletion protection. Default value: false. Valid values:
  • true
  • false
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 Yes The maximum bandwidth of the Internet-facing SLB instance on a pay-by-bandwidth basis.

Valid values: 1 to 10000.

Unit: Mbit/s.

Default value: 1.

The maximum bandwidth of an SLB instance in a VPC is set by the system when you configure the pay-by-data-transfer metering method for the instance.

  • For an Internet-facing SLB instance on a pay-by-bandwidth basis, the Bandwidth property takes effect only when the Bandwidth value is specified for the listener.
  • For an Internet-facing SLB instance on a pay-by-data-transfer basis, the Bandwidth property is overwritten by the Bandwidth value that you specify for the listener.
AddressType String No No The IP address type of the SLB instance.
Default value: internet. Valid values:
  • internet: The SLB instance uses a public IP address. The domain name of the instance is resolved to the public IP address. Therefore, the instance can be accessed over the Internet.
  • intranet: The SLB instance uses a private IP address. The domain name of the instance is resolved to the private IP address. Therefore, the SLB instance can be accessed only over the VPC in which the instance is deployed.
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 (_).

By default, if you do not specify this property, the system assigns a name as the value of this property.

InternetChargeType String No Yes The metering method of the Internet-facing SLB instance.
Default value: paybytraffic. Valid values:
  • paybybandwidth
  • paybytraffic
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:
  • slb.s1.small
  • slb.s2.small
  • slb.s2.medium
  • slb.s3.small
  • slb.s3.medium
  • slb.s3.large
  • slb.s3.xlarge
  • slb.s3.xxlarge

The available specifications vary by region. 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:
  • PayOnDemand: pay-as-you-go
  • PrePay: subscription
ModificationProtectionStatus String No Yes Specifies whether to enable the configuration read-only mode. Default value: NonProtection. Valid values:
  • NonProtection: disables the configuration read-only mode.
  • ConsoleProtection: enables the configuration read-only mode. You can enable this mode in the SLB console.
ModificationProtectionReason String No Yes 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 Internet Protocol version. Valid values:
  • ipv4
  • ipv6
    Note When you set this property to ipv6, you must take note of the available regions and specifications.
AutoRenew Boolean No No Specifies whether to enable auto-renewal for the SLB instance. Default value: false. Valid values:
  • true
  • false
InstanceChargeType String No No The metering method of the SLB instance. Default value: PayBySpec. Valid values:
  • PayBySpec: You are charged for the SLB instance based on its specification.
  • PayByCLCU: You are charged for the SLB instance based on its Load Balancer Capacity Unit (LCU).
    Note This property takes effect when the PayType property is set to PayOnDemand.

Tags syntax

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

Tags properties

Property Type Required Editable Description Constraint
Key String Yes No The key of the tag. The tag key must be 1 to 64 characters in length, and cannot contain http:// or https://. The tag key cannot start with aliyun or acs:.
Value String No No The value of the tag. The tag value can be up to 128 characters in length, and cannot contain http:// or https://. The tag value cannot start with aliyun or acs:.

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 ID of the order.
  • Bandwidth: the maximum bandwidth of the Internet-facing SLB instance.
  • PayType: the billing method of the SLB instance.
  • AddressIPVersion: the Internet Protocol 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

  • YAMLformat

    ROSTemplateFormatVersion: '2015-09-01'
    Description: Test SLB LoadBalancer
    Parameters:
      MasterZoneId:
        Type: String
        AssociationProperty: ALIYUN::ECS::Instance:ZoneId
    Resources:
      LoadBalance:
        Type: ALIYUN::SLB::LoadBalancer
        Properties:
          PayType: PayOnDemand
          AddressType: internet
          LoadBalancerSpec: slb.s1.small
          MasterZoneId:
            Ref: MasterZoneId
          LoadBalancerName: mytest
    Outputs: {}
  • JSONformat

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Description": "Test SLB LoadBalancer",
      "Parameters": {
        "MasterZoneId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId"
        }
      },
      "Resources": {
        "LoadBalance": {
          "Type": "ALIYUN::SLB::LoadBalancer",
          "Properties": {
            "PayType": "PayOnDemand",
            "AddressType": "internet",
            "LoadBalancerSpec": "slb.s1.small",
            "MasterZoneId": {
              "Ref": "MasterZoneId"
            },
            "LoadBalancerName": "mytest"
          }
        }
      },
      "Outputs": {
      }
    }

For more examples, visit BackendServerAttachment.json and BackendServerAttachment.yml. In the examples, the following resource types are used: ALIYUN::SLB::LoadBalancer, ALIYUN::SLB::MasterSlaveServerGroup, and ALIYUN::SLB::BackendServerAttachment.