Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::ESS::LoadBalancerAttachment

Última atualização: Jun 27, 2026

O recurso ALIYUN::ESS::LoadBalancerAttachment associa uma ou mais instâncias do Server Load Balancer (SLB) a um grupo de dimensionamento.

Sintaxe

{
  "Type": "ALIYUN::ESS::LoadBalancerAttachment",
  "Properties": {
    "ScalingGroupId": String,
    "ForceAttach": Boolean,
    "LoadBalancers": List,
    "LoadBalancerConfigs": List
  }
}

Propriedades

Propriedade

Tipo

Obrigatória

Editável

Descrição

Restrição

ScalingGroupId

String

Sim

Não

ID do grupo de dimensionamento.

Nenhuma.

ForceAttach

Boolean

Não

Não

Indica se todas as instâncias do grupo de dimensionamento atual devem ser adicionadas à instância SLB como servidores de backend.

Valores válidos:

  • true

  • false (padrão)

LoadBalancers

List

Não

Não

IDs das instâncias do Classic Load Balancer (CLB, anteriormente conhecido como SLB) para associar ao grupo de dimensionamento.

É possível associar até cinco instâncias SLB a um grupo de dimensionamento.

LoadBalancerConfigs

List

Não

Não

Configurações do CLB.

Para mais informações, consulte Propriedades de LoadBalancerConfigs.

Sintaxe de LoadBalancerConfigs

"LoadBalancerConfigs": [
  {
    "LoadBalancerId": String,
    "Weight": Integer
  }
]

Propriedades de LoadBalancerConfigs

Propriedade

Tipo

Obrigatória

Editável

Descrição

Restrição

LoadBalancerId

String

Não

Não

IDs das instâncias CLB.

Nenhuma.

Weight

Integer

Não

Não

Peso de uma instância do Elastic Compute Service (ECS) como servidor de backend da instância CLB associada.

Um peso maior direciona mais solicitações para a instância ECS. Se Weight for definido como 0, nenhuma solicitação será encaminhada à instância ECS. Valores válidos: 0 a 100.

Valores de retorno

Fn::GetAtt

Nenhum.

Exemplos

  • YAML formato

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      ForceAttach:
        Description:
          en: 'Specifies whether to add all instances in the current scaling group to
            the backend server groups of the attached CLB instance. Valid values:
    
            true
    
            false
    
            Default value: false.'
        Type: Boolean
      LoadBalancerConfigs:
        AssociationProperty: List[Parameter]
        AssociationPropertyMetadata:
          Parameter:
            AssociationPropertyMetadata:
              Parameters:
                LoadBalancerId:
                  Description:
                    en: The ID of the CLB instance.
                  Type: String
                Weight:
                  Description:
                    en: 'The weight of an Elastic Compute Service (ECS) instance as a
                      backend server in the backend server groups of the attached CLB
                      instance. If you increase the weight of an ECS instance, the number
                      of access requests that are forwarded to the ECS instance also increases.
                      If you set Weight to 0 for an ECS instance, no access requests are
                      forwarded to the ECS instance.
    
                      Valid values: 0 to 100.'
                  Type: Number
            Type: Json
        Description:
          en: Load balancer configuration list.
        MaxLength: 20
        Type: Json
      LoadBalancers:
        AssociationProperty: List[Parameter]
        AssociationPropertyMetadata:
          Parameter:
            Description:
              en: The ID of load balancer.
            Type: String
        Description:
          en: 'The ID of CLB instance N that you want to attach to the scaling group.
            Valid values of N: 1 to 5.'
        MaxLength: 5
        Type: Json
      ScalingGroupId:
        Description:
          en: The ID of the scaling group.
        Type: String
    Resources:
      LoadBalancerAttachment:
        Properties:
          ForceAttach:
            Ref: ForceAttach
          LoadBalancerConfigs:
            Ref: LoadBalancerConfigs
          LoadBalancers:
            Ref: LoadBalancers
          ScalingGroupId:
            Ref: ScalingGroupId
        Type: ALIYUN::ESS::LoadBalancerAttachment
                            
  • JSON formato

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ScalingGroupId": {
          "Type": "String",
          "Description": {
            "en": "The ID of the scaling group."
          }
        },
        "ForceAttach": {
          "Type": "Boolean",
          "Description": {
            "en": "Specifies whether to add all instances in the current scaling group to the backend server groups of the attached CLB instance. Valid values:\ntrue\nfalse\nDefault value: false."
          }
        },
        "LoadBalancers": {
          "AssociationPropertyMetadata": {
            "Parameter": {
              "Type": "String",
              "Description": {
                "en": "The ID of load balancer."
              }
            }
          },
          "AssociationProperty": "List[Parameter]",
          "Type": "Json",
          "Description": {
            "en": "The ID of CLB instance N that you want to attach to the scaling group. Valid values of N: 1 to 5."
          },
          "MaxLength": 5
        },
        "LoadBalancerConfigs": {
          "AssociationPropertyMetadata": {
            "Parameter": {
              "AssociationPropertyMetadata": {
                "Parameters": {
                  "LoadBalancerId": {
                    "Type": "String",
                    "Description": {
                      "en": "The ID of the CLB instance."
                    }
                  },
                  "Weight": {
                    "Type": "Number",
                    "Description": {
                      "en": "The weight of an Elastic Compute Service (ECS) instance as a backend server in the backend server groups of the attached CLB instance. If you increase the weight of an ECS instance, the number of access requests that are forwarded to the ECS instance also increases. If you set Weight to 0 for an ECS instance, no access requests are forwarded to the ECS instance.\nValid values: 0 to 100."
                    }
                  }
                }
              },
              "Type": "Json"
            }
          },
          "AssociationProperty": "List[Parameter]",
          "Type": "Json",
          "Description": {
            "en": "Load balancer configuration list."
          },
          "MaxLength": 20
        }
      },
      "Resources": {
        "LoadBalancerAttachment": {
          "Type": "ALIYUN::ESS::LoadBalancerAttachment",
          "Properties": {
            "ScalingGroupId": {
              "Ref": "ScalingGroupId"
            },
            "ForceAttach": {
              "Ref": "ForceAttach"
            },
            "LoadBalancers": {
              "Ref": "LoadBalancers"
            },
            "LoadBalancerConfigs": {
              "Ref": "LoadBalancerConfigs"
            }
          }
        }
      }
    }