ALIYUN::ALB::BackendServerAttachment is used to add backend servers to a server group.

Syntax

{
  "Type": "ALIYUN::ALB::BackendServerAttachment",
  "Properties": {
    "ServerGroupId": String,
    "Servers": List
  }
}

Properties

PropertyTypeRequiredEditableDescriptionConstraint
ServerGroupIdStringYesNoThe ID of the server group. None.
ServersListYesYesThe backend servers. You can add up to 40 backend servers.

For more information, see Servers properties.

Servers syntax

"Servers": [
  {
    "ServerType": String,
    "Description": String,
    "ServerId": String,
    "ServerIp": String,
    "Port": Integer,
    "Weight": Integer
  }
]

Servers properties

PropertyTypeRequiredEditableDescriptionConstraint
ServerTypeStringYesYesThe type of the backend server. Valid values:
  • Ecs: Elastic Compute Service (ECS) instance
  • Eni: elastic network interface (ENI)
  • Eci: elastic container instance
  • Ip: IP address
DescriptionStringNoYesThe description of the backend server. The description must be 2 to 256 characters in length.
ServerIdStringYesYesThe resource ID or IP address. Valid values:
  • Valid value if you set the ServerType property to Ecs: the ID of the ECS instance
  • Valid value if you set the ServerType property to Eni: the ID of the ENI
  • Valid value if you set the ServerType property to Eci: the ID of the elastic container instance
  • Valid value if you set the ServerType property to Ip: the IP address
ServerIpStringNoYesThe IP address in inclusive ENI mode. None.
PortIntegerNoYesThe port that is used by the backend server. Valid values: 1 to 65535.
WeightIntegerNoYesThe weight of the backend server. Valid values: 0 to 100.

Default value: 100.

Note If you set this property to 0, no requests are forwarded to the backend server.

Return values

Fn::GetAtt

ServerGroupId: the ID of the server group.

Examples

  • YAMLformat

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      ServerGroupId:
        Type: String
        Description: The ID of the server group.
        Default: sgp-46ndzg2wz4v5mp1****
    Resources:
      BackendServerAttachment:
        Type: ALIYUN::ALB::BackendServerAttachment
        Properties:
          ServerGroupId:
            Ref: ServerGroupId
          Servers:
            - Description: test
              Port: 80
              ServerId: ecs-bp67acfmxazb4p****
              ServerIp: 192.168.1.1
              ServerType: Ecs
              Weight: 100
    Outputs:
      ServerGroupId:
        Description: The ID of the server group.
        Value:
          Fn::GetAtt:
            - BackendServerAttachment
            - ServerGroupId                
  • JSONformat

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ServerGroupId": {
          "Type": "String",
          "Description": "The ID of the server group.",
          "Default": "sgp-46ndzg2wz4v5mp1****"
        }
      },
      "Resources": {
        "BackendServerAttachment": {
          "Type": "ALIYUN::ALB::BackendServerAttachment",
          "Properties": {
            "ServerGroupId": {
              "Ref": "ServerGroupId"
            },
            "Servers": [
              {
                "Description": "test",
                "Port": 80,
                "ServerId": "ecs-bp67acfmxazb4p****",
                "ServerIp": "192.168.1.1",
                "ServerType": "Ecs",
                "Weight": 100
              }
            ]
          }
        }
      },
      "Outputs": {
        "ServerGroupId": {
          "Description": "The ID of the server group.",
          "Value": {
            "Fn::GetAtt": [
              "BackendServerAttachment",
              "ServerGroupId"
            ]
          }
        }
      }
    }