全部产品
Search
文档中心

资源编排:ALIYUN::ESS::VServerGroupAttachment

更新时间:Dec 14, 2023

ALIYUN::ESS::VServerGroupAttachment类型用于添加负载均衡实例下的一个或者多个虚拟服务器组。

语法

{
  "Type": "ALIYUN::ESS::VServerGroupAttachment",
  "Properties": {
    "ScalingGroupId": String,
    "ForceAttach": Boolean,
    "VServerGroups": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

ScalingGroupId

String

伸缩组的ID。

ForceAttach

Boolean

是否将当前伸缩组内的ECS实例添加到新增的虚拟服务器组。

取值:

  • true:添加。

  • false(默认值):不添加。

VServerGroups

List

伸缩组关联的虚拟服务器组的信息集合。

更多信息,请参见VServerGroups属性

VServerGroups语法

"VServerGroups": [
  {
    "LoadBalancerId": String,
    "VServerGroupAttributes": List
  }
]

VServerGroups属性

属性名称

类型

必须

允许更新

描述

约束

LoadBalancerId

String

虚拟服务器组所属负载均衡实例的ID。

VServerGroupAttributes

List

后端服务器组属性。

更多信息,请参见VServerGroupAttributes属性

VServerGroupAttributes语法

"VServerGroupAttributes": [
  {
    "VServerGroupId": String,
    "Port": Integer,
    "Weight": Integer
  }
]

VServerGroupAttributes属性

属性名称

类型

必须

允许更新

描述

约束

VServerGroupId

String

虚拟服务器组的ID。

Port

Integer

弹性伸缩将ECS实例添加到虚拟服务器组时使用的端口号。

取值范围:1~65535。

Weight

Integer

弹性伸缩将ECS实例添加到虚拟服务器组时设置的权重。

取值范围:0~100。

默认值:50。

返回值

Fn::GetAtt

ScalingGroupId:伸缩组的ID。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      ForceAttach:
        Description:
          en: 'If instances of scaling group are attached/removed from slb backend server
            when attach/detach vserver group from scaling group.
    
            Valid values:
    
            true
    
            false
    
            Default value: false.'
        Required: false
        Type: Boolean
      ScalingGroupId:
        Description:
          en: The ID of the scaling group.
        Required: true
        Type: String
      VServerGroups:
        AssociationProperty: List[Parameter]
        AssociationPropertyMetadata:
          Parameter:
            AssociationPropertyMetadata:
              Parameters:
                LoadBalancerId:
                  Description:
                    en: Load balancer server ID of VServer Group.
                  Required: true
                  Type: String
                VServerGroupAttributes:
                  AssociationProperty: List[Parameters]
                  AssociationPropertyMetadata:
                    Parameters:
                      Port:
                        Description:
                          en: The port will be used for VServer Group backend server.
                        MaxValue: 65535
                        MinValue: 0
                        Required: true
                        Type: Number
                      VServerGroupId:
                        Description:
                          en: ID of VServer Group.
                        Required: true
                        Type: String
                      Weight:
                        Description:
                          en: 'The weight of an ECS instance attached to the VServer Group.
    
                            Default value: 50.'
                        MaxValue: 100
                        MinValue: 0
                        Required: false
                        Type: Number
                  Description:
                    en: A list of VServer Group attributes.
                  MaxLength: 5
                  MinLength: 1
                  Required: true
                  Type: Json
            Required: false
            Type: Json
        Description:
          en: A list of vserver groups attached on scaling group
        MaxLength: 5
        MinLength: 1
        Required: true
        Type: Json
    Resources:
      VServerGroupAttachment:
        Properties:
          ForceAttach:
            Ref: ForceAttach
          ScalingGroupId:
            Ref: ScalingGroupId
          VServerGroups:
            Ref: VServerGroups
        Type: ALIYUN::ESS::VServerGroupAttachment
    Outputs:
      ScalingGroupId:
        Description: The ID of the scaling group.
        Value:
          Fn::GetAtt:
          - VServerGroupAttachment
          - ScalingGroupId
                            
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ScalingGroupId": {
          "Type": "String",
          "Description": {
            "en": "The ID of the scaling group."
          },
          "Required": true
        },
        "ForceAttach": {
          "Type": "Boolean",
          "Description": {
            "en": "If instances of scaling group are attached/removed from slb backend server when attach/detach vserver group from scaling group.\nValid values:\ntrue\nfalse\nDefault value: false."
          },
          "Required": false
        },
        "VServerGroups": {
          "AssociationPropertyMetadata": {
            "Parameter": {
              "AssociationPropertyMetadata": {
                "Parameters": {
                  "LoadBalancerId": {
                    "Type": "String",
                    "Description": {
                      "en": "Load balancer server ID of VServer Group."
                    },
                    "Required": true
                  },
                  "VServerGroupAttributes": {
                    "AssociationPropertyMetadata": {
                      "Parameters": {
                        "VServerGroupId": {
                          "Type": "String",
                          "Description": {
                            "en": "ID of VServer Group."
                          },
                          "Required": true
                        },
                        "Port": {
                          "Type": "Number",
                          "Description": {
                            "en": "The port will be used for VServer Group backend server."
                          },
                          "Required": true,
                          "MinValue": 0,
                          "MaxValue": 65535
                        },
                        "Weight": {
                          "Type": "Number",
                          "Description": {
                            "en": "The weight of an ECS instance attached to the VServer Group.\nDefault value: 50."
                          },
                          "Required": false,
                          "MinValue": 0,
                          "MaxValue": 100
                        }
                      }
                    },
                    "AssociationProperty": "List[Parameters]",
                    "Type": "Json",
                    "Description": {
                      "en": "A list of VServer Group attributes."
                    },
                    "Required": true,
                    "MinLength": 1,
                    "MaxLength": 5
                  }
                }
              },
              "Type": "Json",
              "Required": false
            }
          },
          "AssociationProperty": "List[Parameter]",
          "Type": "Json",
          "Description": {
            "en": "A list of vserver groups attached on scaling group"
          },
          "Required": true,
          "MinLength": 1,
          "MaxLength": 5
        }
      },
      "Resources": {
        "VServerGroupAttachment": {
          "Type": "ALIYUN::ESS::VServerGroupAttachment",
          "Properties": {
            "ScalingGroupId": {
              "Ref": "ScalingGroupId"
            },
            "ForceAttach": {
              "Ref": "ForceAttach"
            },
            "VServerGroups": {
              "Ref": "VServerGroups"
            }
          }
        }
      },
      "Outputs": {
        "ScalingGroupId": {
          "Description": "The ID of the scaling group.",
          "Value": {
            "Fn::GetAtt": [
              "VServerGroupAttachment",
              "ScalingGroupId"
            ]
          }
        }
      }
    }