All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::NLB::LoadBalancer

Last Updated:Jun 10, 2026

Creates 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,
    "DeletionProtectionConfig": Map,
    "ModificationProtectionConfig": Map,
    "Tags": List
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

LoadBalancerName

String

No

Yes

The NLB instance name.

None

AddressIpVersion

String

No

No

The IP version.

Valid values:

  • Ipv4

  • DualStack

ResourceGroupId

String

No

No

The resource group ID.

None

VpcId

String

Yes

No

The VPC ID.

None

LoadBalancerBillingConfig

Map

No

No

The billing configuration.

For more information, see LoadBalancerBillingConfig property.

TrafficAffinityEnabled

Boolean

No

Yes

Whether to enable traffic affinity.

Valid values:

  • true

  • false

BandwidthPackageId

String

No

Yes

The EIP bandwidth plan ID for Internet-facing instances.

None

AddressType

String

Yes

Yes

The IPv4 address type.

Valid values:

  • Internet: Uses a public IP address. The domain name resolves to the public IP for Internet access.

  • Intranet: Uses a private IP address. The domain name resolves to the private IP, accessible only within the deployed VPC.

ZoneMappings

List

Yes

No

The zone-to-vSwitch mappings.

For more information, see ZoneMappings properties.

CrossZoneEnabled

Boolean

No

Yes

Whether to enable cross-zone load balancing.

Valid values:

  • true

  • false

LoadBalancerType

String

No

No

The NLB instance type.

None

DeletionProtectionConfig

Map

No

Yes

The deletion protection configuration.

For more information, see DeletionProtectionConfig properties.

ModificationProtectionConfig

Map

No

Yes

The configuration of deletion protection.

For more information, see ModificationProtectionConfig properties.

Tags

List

No

Yes

The tags.

For more information, see Tags properties.

LoadBalancerBillingConfig syntax

"LoadBalancerBillingConfig": {
  "PayType": String
}

LoadBalancerBillingConfig property

Property

Type

Required

Editable

Description

Constraint

PayType

String

No

No

The billing method.

Valid values:

  • PayAsYouGo

  • PostPaid

  • PayOnDemand

  • Postpaid

  • PostPay

ZoneMappings syntax

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

ZoneMappings properties

Property

Type

Required

Editable

Description

Constraint

ZoneId

String

Yes

No

The zone ID.

You can call the DescribeZones operation to query the zones of the NLB instance.

VSwitchId

String

Yes

No

The vSwitch of the zone.

Only one vSwitch per zone.

AllocationId

String

No

No

The EIP ID.

None

PrivateIPv4Address

String

No

No

The IPv4 address.

None

LoadBalancerAddresses

List

No

No

The NLB instance endpoints.

This property takes precedence over AllocationId and EipType in the "ZoneMappings" section. For more information, see LoadBalancerAddresses properties.

EipType

String

No

No

The EIP type.

Valid values:

  • Common: EIP

  • Anycast: Anycast EIP

Note

For information about the regions in which you can associate Anycast EIPs with NLB instances, see Associate Anycast EIPs with an ALB instance.

LoadBalancerAddresses syntax

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

LoadBalancerAddresses properties

Property

Type

Required

Editable

Description

Constraint

AllocationId

String

Yes

No

The EIP ID.

None

PrivateIPv4Address

String

No

No

The IPv4 address.

None

DeletionProtectionConfig syntax

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

DeletionProtectionConfig properties

Property

Type

Required

Editable

Description

Constraint

Enabled

String

Yes

Yes

Whether to enable deletion protection.

Valid values:

  • true

  • false (default)

Reason

String

No

Yes

The reason for enabling or disabling deletion protection.

2-128 characters. Supports letters, digits, periods (.), underscores (_), and hyphens (-). Must start with a letter.

ModificationProtectionConfig syntax

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

ModificationProtectionConfig properties

Property

Type

Required

Editable

Description

Constraint

Reason

String

No

Yes

The reason why deletion protection is enabled.

2-128 characters. Supports letters, digits, periods (.), underscores (_), and hyphens (-). Must start with a letter.

Note

This property takes effect only if Status is set to ConsoleProtection.

Status

String

Yes

Yes

Specifies whether deletion protection is enabled.

Valid values:

  • NonProtection: Deletion protection is disabled. In this case, you cannot pass the reason for enabling the configuration read-only mode. You must clear the setting of the Reason property.

  • ConsoleProtection: Deletion protection is enabled. In this case, you can pass the reason for enabling the configuration read-only mode.

Note

If set to ConsoleProtection, instance configurations cannot be modified in the NLB console but can be modified by calling API operations.

Tags syntax

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

Tags properties

Property

Type

Required

Editable

Description

Constraint

Key

String

Yes

No

The tag key.

Up to 128 characters. Cannot contain http:// or https://, and cannot start with acs: or aliyun.

Maximum 20 tags per call.

Value

String

No

No

The tag value.

Up to 128 characters. Cannot start with acs: or aliyun, and cannot contain http:// or https://.

Maximum 20 tags per call.

Return values

Fn::GetAtt

  • AddressIpVersion: the NLB instance IP version.

  • VpcId: the VPC ID.

  • LoadBalancerId: the NLB instance ID.

  • AddressType: the IPv4 address type.

  • DNSName: the NLB domain name.

  • ZoneMappings: the zone-to-vSwitch mappings.

  • LoadBalancerType: the NLB instance type.

  • Arn: the Alibaba Cloud Resource Name (ARN).

Examples

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