ALIYUN::NLB::LoadBalancer is used to create a Network Load Balancer (NLB) instance.

Syntax

{
  "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
  }
}

Properties

Property Type Required Editable Description Constraint
LoadBalancerName String No Yes The name of the NLB instance. None.
AddressIpVersion String No No The Internet Protocol version of the NLB instance. Valid values:
  • Ipv4
  • DualStack
ResourceGroupId String No No The ID of the resource group. None.
VpcId String Yes No The ID of the virtual private cloud (VPC) to which the NLB instance belongs. None.
LoadBalancerBillingConfig Map No No The billing configurations of the NLB instance. For more information, see LoadBalancerBillingConfig property.
TrafficAffinityEnabled Boolean No Yes Specifies whether to enable traffic affinity. Valid values:
  • true
  • false
BandwidthPackageId String No Yes The ID of the elastic IP address (EIP) bandwidth plan that is associated with the Internet-facing NLB instance. None.
AddressType String Yes Yes The type of the IPv4 address that is used by the NLB instance. 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 in which the NLB instance is deployed.
ZoneMappings List Yes No The mappings between zones and vSwitches. For more information, see ZoneMappings properties.
CrossZoneEnabled Boolean No Yes Specifies whether to enable cross-zone load balancing. Valid values:
  • true
  • false
LoadBalancerType String No No The type of the NLB instance. None.

LoadBalancerBillingConfig syntax

"LoadBalancerBillingConfig": {
  "PayType": String
}

LoadBalancerBillingConfig property

Property Type Required Editable Description Constraint
PayType String No No The billing method of the NLB instance. Valid values:
  • PayAsYouGo
  • PostPaid
  • PayOnDemand
  • Postpaid
  • PostPay

ZoneMappings syntax

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

ZoneMappings properties

Property Type Required Editable Description Constraint
ZoneId String Yes No The ID of the zone in which you want to deploy the NLB instance. You can call the DescribeZones operation to query the information about the zone that corresponds to the specified zone ID.
VSwitchId String Yes No The ID of the vSwitch that you want to deploy in the zone. You can use only one vSwitch in each zone.
AllocationId String No No The ID of the EIP. None.
PrivateIPv4Address String No No The IPv4 address. None.

Return values

Fn::GetAtt

  • AddressIpVersion: the Internet Protocol version of the NLB instance.
  • VpcId: the ID of the VPC to which the NLB instance belongs.
  • LoadBalancerId: the ID of the NLB instance.
  • AddressType: the type of the IPv4 address that is used by the NLB instance.
  • DNSName: the domain name of the NLB instance.
  • ZoneMappings: the mappings between zones and vSwitches.
  • LoadBalancerType: the type of the NLB instance.

Examples

JSON format

{
  "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"
        ]
      }
    }
  }
}