ALIYUN::GWLB::LoadBalancer

ALIYUN::GWLB::LoadBalancer类型用于创建负载均衡实例。

语法

{
  "Type": "ALIYUN::GWLB::LoadBalancer",
  "Properties": {
    "VpcId": String,
    "ZoneMappings": List,
    "AddressIpVersion": String,
    "LoadBalancerName": String,
    "ResourceGroupId": String,
    "Tags": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

VpcId

String

专有网络 VPC ID。

ZoneMappings

List

可用区及交换机映射列表。

至少需要添加一个可用区,最多支持添加 20 个可用区。若当前地域支持 2 个及以上的可用区,建议添加 2 个及以上可用区。更多信息,请参考ZoneMappings属性

AddressIpVersion

String

协议版本。

取值:

  • Ipv4(默认值):Ipv4 类型。

LoadBalancerName

String

网关型负载均衡实例名称。

长度为 2~128 个英文或中文字符,必须以字母或中文开头,可包含数字、半角句号(.)、下划线(_)和短划线(-)。

ResourceGroupId

String

资源组 ID。

Tags

List

负载均衡实例绑定的标签列表。

更多信息,请参考Tags属性

ZoneMappings语法

"ZoneMappings": [
  {
    "ZoneId": String,
    "VSwitchId": String
  }
]

ZoneMappings属性

属性名称

类型

必须

允许更新

描述

约束

VSwitchId

String

可用区对应的交换机,

每个可用区只能使用一台交换机和一个子网。

ZoneId

String

可用区 ID。

Tags语法

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

Tags属性

属性名称

类型

必须

允许更新

描述

约束

Key

String

标签键。

一旦传入该值,则不允许为空字符串。

一个标签最多支持 128 个字符,不能以aliyunacs:开头,不能包含http://或者https://

Value

String

标签值。

最多支持 256 个字符,不能包含http://https://

返回值

Fn::GetAtt

  • LoadBalancerName:网关型负载均衡实例名称。

  • AddressIpVersion:协议版本。

  • VpcId:专有网络 VPC ID。

  • ResourceGroupId:资源组 ID。

  • CreateTime:负载均衡实例的创建时间。

  • LoadBalancerId:网关型负载均衡实例的 ID。

  • ZoneMappings:可用区及交换机映射列表。

  • BusinessStatus:IP 地址池实例的业务状态。

  • Tags:标签列表。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  VpcId:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Type: String
    Description:
      en: The ID of the VPC which the Gateway Load Balancer instance belongs.
    Required: true
  ZoneMappings:
    AssociationPropertyMetadata:
      Parameters:
        ZoneId:
          AssociationProperty: ZoneId
          Type: String
          Description:
            en: The ID of the zone to which the Gateway Load Balancer instance belongs.
          Required: true
        VSwitchId:
          AssociationPropertyMetadata:
            VpcId: ${VpcId}
            ZoneId: ${ZoneId}
          AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
          Type: String
          Description:
            en: The ID of the vSwitch that corresponds to the zone. Each zone can use only one vSwitch and subnet.
          Required: true
    AssociationProperty: List[Parameters]
    Type: Json
    Description:
      en: The List of zones and vSwitches mapped. You must add at least one zone and a maximum of 20 zones. If the current region supports two or more zones, we recommend that you add two or more zones.
    Required: true
    MinLength: 1
    MaxLength: 20
Resources:
  ExtensionResource:
    Type: ALIYUN::GWLB::LoadBalancer
    Properties:
      VpcId:
        Ref: VpcId
      ZoneMappings:
        Ref: ZoneMappings
Outputs:
  LoadBalancerName:
    Description: The name of the Gateway Load Balancer instance.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - LoadBalancerName
  AddressIpVersion:
    Description: The protocol version.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - AddressIpVersion
  VpcId:
    Description: The ID of the VPC which the Gateway Load Balancer instance belongs.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - VpcId
  ResourceGroupId:
    Description: The ID of the resource group.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ResourceGroupId
  CreateTime:
    Description: The resource creation time, in Greenwich Mean Time, in the format of **yyyy-MM-ddTHH:mm:ssZ**.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CreateTime
  LoadBalancerId:
    Description: The ID of the Gateway Load Balancer instance.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - LoadBalancerId
  ZoneMappings:
    Description: The List of zones and vSwitches mapped. You must add at least one zone and a maximum of 20 zones. If the current region supports two or more zones, we recommend that you add two or more zones.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ZoneMappings
  BusinessStatus:
    Description: The business status of Gateway Load Balancing.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - BusinessStatus
  Tags:
    Description: The list of tags.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Tags
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "VpcId": {
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": {
        "en": "The ID of the VPC which the Gateway Load Balancer instance belongs."
      },
      "Required": true
    },
    "ZoneMappings": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "ZoneId": {
            "AssociationProperty": "ZoneId",
            "Type": "String",
            "Description": {
              "en": "The ID of the zone to which the Gateway Load Balancer instance belongs."
            },
            "Required": true
          },
          "VSwitchId": {
            "AssociationPropertyMetadata": {
              "VpcId": "${VpcId}",
              "ZoneId": "${ZoneId}"
            },
            "AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
            "Type": "String",
            "Description": {
              "en": "The ID of the vSwitch that corresponds to the zone. Each zone can use only one vSwitch and subnet."
            },
            "Required": true
          }
        }
      },
      "AssociationProperty": "List[Parameters]",
      "Type": "Json",
      "Description": {
        "en": "The List of zones and vSwitches mapped. You must add at least one zone and a maximum of 20 zones. If the current region supports two or more zones, we recommend that you add two or more zones."
      },
      "Required": true,
      "MinLength": 1,
      "MaxLength": 20
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::GWLB::LoadBalancer",
      "Properties": {
        "VpcId": {
          "Ref": "VpcId"
        },
        "ZoneMappings": {
          "Ref": "ZoneMappings"
        }
      }
    }
  },
  "Outputs": {
    "LoadBalancerName": {
      "Description": "The name of the Gateway Load Balancer instance.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "LoadBalancerName"
        ]
      }
    },
    "AddressIpVersion": {
      "Description": "The protocol version.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "AddressIpVersion"
        ]
      }
    },
    "VpcId": {
      "Description": "The ID of the VPC which the Gateway Load Balancer instance belongs.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "VpcId"
        ]
      }
    },
    "ResourceGroupId": {
      "Description": "The ID of the resource group.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ResourceGroupId"
        ]
      }
    },
    "CreateTime": {
      "Description": "The resource creation time, in Greenwich Mean Time, in the format of **yyyy-MM-ddTHH:mm:ssZ**.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CreateTime"
        ]
      }
    },
    "LoadBalancerId": {
      "Description": "The ID of the Gateway Load Balancer instance.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "LoadBalancerId"
        ]
      }
    },
    "ZoneMappings": {
      "Description": "The List of zones and vSwitches mapped. You must add at least one zone and a maximum of 20 zones. If the current region supports two or more zones, we recommend that you add two or more zones.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ZoneMappings"
        ]
      }
    },
    "BusinessStatus": {
      "Description": "The business status of Gateway Load Balancing.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "BusinessStatus"
        ]
      }
    },
    "Tags": {
      "Description": "The list of tags.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Tags"
        ]
      }
    }
  }
}