文档

ALIYUN::NLB::LoadBalancer

更新时间:

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

语法

{
  "Type": "ALIYUN::NLB::LoadBalancer",
  "Properties": {
    "LoadBalancerName": String,
    "AddressIpVersion": String,
    "ResourceGroupId": String,
    "VpcId": String,
    "LoadBalancerBillingConfig": Map,
    "TrafficAffinityEnabled": Boolean,
    "BandwidthPackageId": String,
    "AddressType": String,
    "ZoneMappings": List,
    "CrossZoneEnabled": Boolean,
    "LoadBalancerType": String,
    "DeletionProtectionConfig": Map,
    "ModificationProtectionConfig": Map,
    "Tags": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

LoadBalancerName

String

负载均衡实例的名称。

AddressIpVersion

String

负载均衡实例的IP版本。

取值:

  • Ipv4

  • DualStack

ResourceGroupId

String

资源组ID。

VpcId

String

负载均衡实例的所属VPC ID。

LoadBalancerBillingConfig

Map

负载均衡实例的计费配置。

更多信息,请参见LoadBalancerBillingConfig属性

TrafficAffinityEnabled

Boolean

是否启用流量相关性。

取值:

  • true:启用流量相关性。

  • false:未启用流量相关性。

BandwidthPackageId

String

公网类型实例关联的共享带宽包ID。

AddressType

String

负载均衡IPv4的网络地址类型。

取值:

  • Internet:公网。负载均衡具有公网IP地址,DNS域名被解析到公网IP,因此可以在公网环境访问。

  • Intranet:私网。负载均衡只有私网IP地址,DNS域名被解析到私网IP,因此只能被负载均衡所在VPC的内网环境访问。

ZoneMappings

List

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

更多信息,请参见ZoneMappings属性

CrossZoneEnabled

Boolean

是否启用跨区域负载均衡。

取值:

  • true:启用跨区域。

  • false:未启用跨区域。

LoadBalancerType

String

负载均衡实例类型。

DeletionProtectionConfig

Map

删除保护配置。

更多信息,请参见DeletionProtectionConfig属性

ModificationProtectionConfig

Map

修改保护配置。

更多信息,请参见ModificationProtectionConfig属性

Tags

List

标签列表。

更多信息,请参见Tags属性

LoadBalancerBillingConfig语法

"LoadBalancerBillingConfig": {
  "PayType": String
}

LoadBalancerBillingConfig属性

属性名称

类型

必须

允许更新

描述

约束

PayType

String

实例的计费类型。

取值:

  • PayAsYouGo

  • PostPaid

  • PayOnDemand

  • Postpaid

  • PostPay

ZoneMappings语法

"ZoneMappings": [
  {
    "ZoneId": String,
    "VSwitchId": String,
    "AllocationId": String,
    "PrivateIPv4Address": String,
    "LoadBalancerAddresses": List
  }
]

ZoneMappings属性

属性名称

类型

必须

允许更新

描述

约束

ZoneId

String

负载均衡实例的可用区ID。

您可以通过调用DescribeZones接口获取可用区ID对应的可用区的信息。

VSwitchId

String

可用区对应的交换机。

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

AllocationId

String

弹性公网IP的实例ID。

PrivateIPv4Address

String

IPv4地址。

LoadBalancerAddresses

List

负载均衡器地址。 

此属性的优先级高于ZoneMappings中的AllocationId和EipType。更多信息,请参见LoadBalancerAddresses属性

EipType

String

公网EIP的类型。

取值:

  • Common:弹性公网IP,简称EIP。

  • Anycast:任播弹性公网IP,简称Anycast EIP。

说明

ALB支持绑定Anycast EIP的地域,请参见ALB绑定Anycast EIP实现多地域业务就近接入

LoadBalancerAddresses语法

"LoadBalancerAddresses": {
  "AllocationId": String,
  "PrivateIPv4Address": String
}

LoadBalancerAddresses属性

属性名称

类型

必须

允许更新

描述

约束

AllocationId

String

弹性公网IP的实例ID。

PrivateIPv4Address

String

IPv4地址。

DeletionProtectionConfig语法

"DeletionProtectionConfig": {
  "Enabled": String,
  "Reason": String
}

DeletionProtectionConfig属性

属性名称

类型

必须

允许更新

描述

约束

Enabled

String

删除保护状态。

取值:

  • true:开启状态。

  • false(默认值):关闭状态。

Reason

String

更改删除保护状态的原因。

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

ModificationProtectionConfig语法

"ModificationProtectionConfig": {
  "Reason": String,
  "Status": String
}

ModificationProtectionConfig属性

属性名称

类型

必须

允许更新

描述

约束

Reason

String

输入开启修改保护的原因。

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

说明

仅在StatusConsoleProtection时有效且合法。

Status

String

网络型负载均衡修改保护状态。

取值:

  • NonProtection:不保护,表示不允许传入保护配置的Reason。如果配置了保护配置的Reason,则清空其配置信息。

  • ConsoleProtection:控制台修改保护,此时允许传入保护配置的Reason。

说明

当取值为ConsoleProtection,即开启修改保护后,用户不能通过负载均衡控制台修改实例配置,但可以通过调用API修改实例配置。

Tags语法

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

Tags属性

属性名称

类型

必须

允许更新

描述

约束

Key

String

标签键。

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

一次调用最多支持添加20个标签。

Value

String

标签值。

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

一次调用最多支持添加20个标签。

返回值

Fn::GetAtt

  • AddressIpVersion:负载均衡实例的IP版本。

  • VpcId:负载均衡实例的所属的VPC ID。

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

  • AddressType:负载均衡IPv4的网络地址类型。

  • DNSName:DNS域名。

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

  • LoadBalancerType:负载均衡实例类型。

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  VpcId:
    Type: String
    Description: The ID of the virtual private cloud (VPC) where the NLB instance is deployed.
  AddressType:
    Type: String
    Description: |-
      The type of IP address that the NLB instance uses to provide services. Valid values:
      Internet: The NLB instance uses a public IP address. The domain name of the NLB instance is resolved to the public IP address. Therefore, the NLB instance can be accessed over the Internet.
      Intranet: The NLB instance uses a private IP address. The domain name of the NLB instance is resolved to the private IP address. Therefore, the NLB instance can be accessed over the VPC where the NLB instance is deployed.
    AllowedValues:
      - Internet
      - Intranet
  ZoneMappings:
    Type: Json
    Description: The zones and the vSwitches in the zones. You must specify at least two zones.
    MinLength: 2
    MaxLength: 3
Resources:
  LoadBalancer:
    Type: ALIYUN::NLB::LoadBalancer
    Properties:
      VpcId:
        Ref: VpcId
      AddressType:
        Ref: AddressType
      ZoneMappings:
        Ref: ZoneMappings
Outputs:
  AddressIpVersion:
    Description: The version of IP address that the NLB instance uses to provide services.
    Value:
      Fn::GetAtt:
        - LoadBalancer
        - AddressIpVersion
  VpcId:
    Description: The ID of the virtual private cloud (VPC) where the NLB instance is deployed.
    Value:
      Fn::GetAtt:
        - LoadBalancer
        - VpcId
  LoadBalancerId:
    Description: The ID of the NLB instance.
    Value:
      Fn::GetAtt:
        - LoadBalancer
        - LoadBalancerId
  AddressType:
    Description: The type of IP address that the NLB instance uses to provide services.
    Value:
      Fn::GetAtt:
        - LoadBalancer
        - AddressType
  DNSName:
    Description: The domain name of the NLB instance.
    Value:
      Fn::GetAtt:
        - LoadBalancer
        - DNSName
  ZoneMappings:
    Description: The zones, vSwitches and addresses which are mapped to the zones.
    Value:
      Fn::GetAtt:
        - LoadBalancer
        - ZoneMappings
  LoadBalancerType:
    Description: The type of the NLB instance.
    Value:
      Fn::GetAtt:
        - LoadBalancer
        - LoadBalancerType

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "VpcId": {
      "Type": "String",
      "Description": "The ID of the virtual private cloud (VPC) where the NLB instance is deployed."
    },
    "AddressType": {
      "Type": "String",
      "Description": "The type of IP address that the NLB instance uses to provide services. Valid values:\nInternet: The NLB instance uses a public IP address. The domain name of the NLB instance is resolved to the public IP address. Therefore, the NLB instance can be accessed over the Internet.\nIntranet: The NLB instance uses a private IP address. The domain name of the NLB instance is resolved to the private IP address. Therefore, the NLB instance can be accessed over the VPC where the NLB instance is deployed.",
      "AllowedValues": [
        "Internet",
        "Intranet"
      ]
    },
    "ZoneMappings": {
      "Type": "Json",
      "Description": "The zones and the vSwitches in the zones. You must specify at least two zones.",
      "MinLength": 2,
      "MaxLength": 3
    }
  },
  "Resources": {
    "LoadBalancer": {
      "Type": "ALIYUN::NLB::LoadBalancer",
      "Properties": {
        "VpcId": {
          "Ref": "VpcId"
        },
        "AddressType": {
          "Ref": "AddressType"
        },
        "ZoneMappings": {
          "Ref": "ZoneMappings"
        }
      }
    }
  },
  "Outputs": {
    "AddressIpVersion": {
      "Description": "The version of IP address that the NLB instance uses to provide services.",
      "Value": {
        "Fn::GetAtt": [
          "LoadBalancer",
          "AddressIpVersion"
        ]
      }
    },
    "VpcId": {
      "Description": "The ID of the virtual private cloud (VPC) where the NLB instance is deployed.",
      "Value": {
        "Fn::GetAtt": [
          "LoadBalancer",
          "VpcId"
        ]
      }
    },
    "LoadBalancerId": {
      "Description": "The ID of the NLB instance.",
      "Value": {
        "Fn::GetAtt": [
          "LoadBalancer",
          "LoadBalancerId"
        ]
      }
    },
    "AddressType": {
      "Description": "The type of IP address that the NLB instance uses to provide services.",
      "Value": {
        "Fn::GetAtt": [
          "LoadBalancer",
          "AddressType"
        ]
      }
    },
    "DNSName": {
      "Description": "The domain name of the NLB instance.",
      "Value": {
        "Fn::GetAtt": [
          "LoadBalancer",
          "DNSName"
        ]
      }
    },
    "ZoneMappings": {
      "Description": "The zones, vSwitches and addresses which are mapped to the zones.",
      "Value": {
        "Fn::GetAtt": [
          "LoadBalancer",
          "ZoneMappings"
        ]
      }
    },
    "LoadBalancerType": {
      "Description": "The type of the NLB instance.",
      "Value": {
        "Fn::GetAtt": [
          "LoadBalancer",
          "LoadBalancerType"
        ]
      }
    }
  }
}

  • 本页导读 (1)
文档反馈