全部产品
Search
文档中心

Resource Orchestration Service:ALIYUN::SLB::VServerGroup

更新时间:Jul 02, 2025

ALIYUN::SLB::VServerGroup digunakan untuk membuat grup server dan menambahkan backend server ke instance Server Load Balancer (SLB).

Sintaks

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

Properti

Properti

Tipe

Diperlukan

Dapat Diedit

Deskripsi

Kendala

VServerGroupName

String

Ya

Tidak

Nama grup server.

Tidak ada.

BackendServers

List

Tidak

Ya

Backend server yang ingin Anda tambahkan ke instance SLB.

Anda dapat menambahkan hingga 20 instance Elastic Compute Service (ECS).

Untuk informasi lebih lanjut, lihat properti BackendServers.

LoadBalancerId

String

Ya

Tidak

ID instance SLB.

Tidak ada.

Tags

List

Tidak

Ya

Tag.

Untuk informasi lebih lanjut, lihat properti Tags.

Sintaks BackendServers

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

Properti BackendServers

Properti

Tipe

Diperlukan

Dapat Diedit

Deskripsi

Kendala

ServerId

String

Ya

Ya

ID instance yang ingin Anda gunakan sebagai backend server.

Tidak ada.

Port

Integer

Ya

Ya

Port dari backend server.

Nilai valid: 1 hingga 65535.

Weight

Integer

Tidak

Ya

Bobot dari backend server.

Nilai valid: 0 hingga 100.

Type

String

Tidak

Ya

Tipe dari backend server.

Nilai valid:

  • ecs (default): Instance ECS

  • eni: elastic network interface (ENI)

Description

String

Tidak

Ya

Deskripsi dari backend server.

Deskripsi harus memiliki panjang 1 hingga 80 karakter, dan dapat berisi huruf, angka, tanda hubung (-), garis miring (/), titik (.), dan garis bawah (_).

ServerIp

String

Tidak

Ya

Alamat IP dari backend server.

Alamat IP dari instance ECS atau ENI didukung.

Sintaks Tags

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

Properti Tags

Properti

Tipe

Diperlukan

Dapat Diedit

Deskripsi

Kendala

Key

String

Ya

Tidak

Kunci tag.

Tidak ada.

Value

String

Tidak

Tidak

Nilai tag.

Tidak ada.

Nilai kembali

Fn::GetAtt

  • VServerGroupId: ID dari grup server.

  • BackendServers: Backend server yang ditambahkan ke instance SLB.

  • LoadBalancerId: ID dari instance SLB.

  • Arn: Alibaba Cloud Resource Name (ARN).

Contoh

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      LoadBalancerId:
        AssociationProperty: ALIYUN::SLB::Instance::InstanceId
        Type: String
        Description: The id of load balancer.
      ECSInstanceId:
        Type: String
        AssociationProperty: ALIYUN::ECS::Instance::InstanceId
    Resources:
      VServerGroup:
        Type: ALIYUN::SLB::VServerGroup
        Properties:
          VServerGroupName:
            Ref: ALIYUN::StackName
          LoadBalancerId:
            Ref: LoadBalancerId
          BackendServers:
            - ServerId:
                Ref: ECSInstanceId
              Port: '80'
    Outputs:
      VServerGroupId:
        Description: The id of VServerGroup created.
        Value:
          Fn::GetAtt:
            - VServerGroup
            - VServerGroupId
      BackendServers:
        Description: Backend server list in this VServerGroup.
        Value:
          Fn::GetAtt:
            - VServerGroup
            - BackendServers
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "LoadBalancerId": {
          "AssociationProperty":"ALIYUN::SLB::Instance::InstanceId",
          "Type":"String",
          "Description": "The id of load balancer."
        },
        "ECSInstanceId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::Instance::InstanceId"
        }
      },
      "Resources": {
        "VServerGroup": {
          "Type": "ALIYUN::SLB::VServerGroup",
          "Properties": {
            "VServerGroupName": {
              "Ref": "ALIYUN::StackName"
            },
            "LoadBalancerId": {
              "Ref": "LoadBalancerId"
            },
            "BackendServers": [
              {
                "ServerId": {
                  "Ref": "ECSInstanceId"
                },
                "Port": "80"
              }
            ]
          }
        }
      },
      "Outputs": {
        "VServerGroupId": {
          "Description": "The id of VServerGroup created.",
          "Value": {
            "Fn::GetAtt": [
              "VServerGroup",
              "VServerGroupId"
            ]
          }
        },
        "BackendServers": {
          "Description": "Backend server list in this VServerGroup.",
          "Value": {
            "Fn::GetAtt": [
              "VServerGroup",
              "BackendServers"
            ]
          }
        }
      }
    }