The ALIYUN::SLB::VServerGroup type is used to create a virtual server group and add backend servers to the server load balancer instance.

Statement

{
    "Type" : "ALIYUN::SLB::VServerGroup",
    "Properties" : {
         "VServerGroupName" : String,
         "BackendServers" : List,
         "LoadBalancerId" : String
    }
}
			

Properties

Parameter Type Required Editable Description Constraint
VServerGroupName String Yse No The name of the VServer group. None
BackendServers list Retained Yes The ECS instances to be added. The list can contain a maximum of 20 elements.
LoadBalancerId String Yse No The IDs of SLB instances. None

BackendServers syntax

"BackendServers" : [
    {
        "ServerId" : String,
        "Port" : Integer,
        "Weight" : Integer
    }
]
			

BackendServers properties

Parameter Type Required Editable Description Constraint
ServerId String Retained Yes The ID of the ECS instance that acts as a backend server. None
Port Integer Retained Yes The ECS port number that is listened to in the server load balancer instance. Valid values: 1 to 65535.
Weight Integer Retained Yes Weights of the ECS instances in the server load balancer instance. Valid values: 0 to 100.

Response parameters

Fn::GetAtt

  • VServerGroupId: The ID of the VServer group.
  • BackendServers: List of backend servers added to the server load balancer instance.

Sample request

{
    "ROSTemplateFormatVersion": "2015-09-01",
    "Resources": {
        "CreateVServerGroup": {
            "Type": "ALIYUN::SLB::VServerGroup",
            "Properties": {
                "LoadBalancerId": "lb-2zenh4ndwrqg14yt0****",
                "VServerGroupName": "VServerGroup-****",
                "BackendServers": [
                    {
                        "ServerId": "i-25zsk****",
                        "Weight": 20,
                        "Port": 8080
                    },
                    {
                        "ServerId": "i-25zsk****",
                        "Weight": 100,
                        "Port": 8081
                    }
                ]
            }
        }
    },
    "Outputs": {
        "VServerGroupId": {
            "Value" : {"Fn::GetAttr": ["CreateVServerGroup", "VServerGroupId"]
         }
      }
   }
}