All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::NLB::Listener

Last Updated:Feb 06, 2026

Use the ALIYUN::NLB::Listener resource type to create a listener.

Syntax

{
  "Type": "ALIYUN::NLB::Listener",
  "Properties": {
    "CaEnabled": Boolean,
    "ListenerPort": Integer,
    "StartPort": Integer,
    "Cps": Integer,
    "ServerGroupId": String,
    "IdleTimeout": Integer,
    "LoadBalancerId": String,
    "Mss": Integer,
    "ListenerProtocol": String,
    "SecurityPolicyId": String,
    "ListenerDescription": String,
    "AlpnPolicy": String,
    "CaCertificateIds": List,
    "EndPort": Integer,
    "ProxyProtocolEnabled": Boolean,
    "CertificateIds": List,
    "SecSensorEnabled": Boolean,
    "Enable": Boolean,
    "AlpnEnabled": Boolean,
    "Tags": List,
    "ServerGroupTuples": List,
    "ProxyProtocolV2Config": Map
  }
}

Properties

Property name

Type

Required

Update allowed

Description

Constraints

ListenerPort

Integer

Yes

No

The frontend port that is used by the Server Load Balancer (SLB) instance.

The value must be in the range of 1 to 65535.

ListenerProtocol

String

Yes

No

The frontend protocol that is used by the SLB instance.

Valid values:

  • TCP

  • UDP

  • TCPSSL

LoadBalancerId

String

Yes

No

The ID of the SLB instance.

None

AlpnEnabled

Boolean

No

Yes

Specifies whether to enable Application-Layer Protocol Negotiation (ALPN).

Valid values:

  • true: Enabled

  • false: Disabled.

AlpnPolicy

String

No

Yes

Application-Layer Protocol Negotiation (ALPN) agent.

None

CaCertificateIds

List

No

No

The ID of the Certificate Authority (CA) certificate.

None

CaEnabled

Boolean

No

Yes

Specifies whether to enable mutual authentication.

Valid values:

  • true: The feature is enabled.

  • false (default): Disabled.

CertificateIds

List

No

Yes

The ID of the signing certificate.

None

Cps

Integer

No

Yes

The number of new connections per second.

The value must be 3000.

Enable

Boolean

No

No

Specifies whether to enable the listener.

Valid values:

  • true: The item is enabled.

  • False means it is not enabled.

EndPort

Integer

No

No

The last port in the listener port range.

The value must be 65535.

IdleTimeout

Integer

No

Yes

The timeout period for idle connections.

The value must be in the range of 1 to 60. Unit: seconds.

ListenerDescription

String

No

Yes

The description of the listener.

The description must be 2 to 256 characters in length. It can contain letters, digits, hyphens (-), forward slashes (/), periods (.), and underscores (_).

Mss

Integer

No

Yes

MSS autonegotiation

None

ProxyProtocolEnabled

Boolean

No

Yes

Specifies whether to enable Proxy Protocol v2.

Valid values:

  • True means enabled.

  • false: The feature is disabled.

ProxyProtocolV2Config

Map

No

Yes

The configuration for using the Proxy Protocol to pass client information, such as VpcId, PrivateLinkEpId, and PrivateLinkEpsId, to backend servers.

For more information, see ProxyProtocolV2Config properties.

SecSensorEnabled

Boolean

No

Yes

Is secondary monitoring enabled?

Valid values:

  • true: Enables the option.

  • false: Disabled.

SecurityPolicyId

String

No

Yes

The ID of the security policy.

None

ServerGroupId

String

No

Yes

The ID of the server group to which requests are forwarded.

None

ServerGroupTuples

List

No

Yes

Forward target server tuple.

A combination of multiple destination server group IDs to which requests are forwarded. For more information, see ServerGroupTuples properties.

StartPort

Integer

No

No

The first port in the listener port range.

The value must be 1.

Tags

List

No

Yes

The list of tags.

For more information, see Tags properties.

ServerGroupTuples syntax

"ServerGroupTuples": [{
    "ServerGroupId": String,
    "Weight": Integer
}]

ServerGroupTuples properties

Property name

Type

Required

Update allowed

Description

Constraints

ServerGroupId

String

No

Yes

The ID of the destination server group to which requests are forwarded.

None

Weight

Integer

No

Yes

The weight.

A larger value indicates a higher weight. A server group with a higher weight receives more requests. The value must be in the range of 0 to 100.

ProxyProtocolV2Config syntax

"ProxyProtocolV2Config": {
    "Ppv2PrivateLinkEpIdEnabled": Boolean,
    "Ppv2PrivateLinkEpsIdEnabled": Boolean,
    "Ppv2VpcIdEnabled": Boolean
  }

ProxyProtocolV2Config properties

Property name

Type

Required

Update allowed

Description

Constraints

Ppv2PrivateLinkEpIdEnabled

Boolean

No

Yes

Specifies whether to use the Proxy Protocol to pass the PrivateLinkEpId to backend servers.

Valid values:

  • true: Enabled.

  • false indicates a shutdown.

Ppv2PrivateLinkEpsIdEnabled

Boolean

No

Yes

Specifies whether to use the Proxy Protocol to pass the PrivateLinkEpsId to backend servers.

Valid values:

  • true: Enabled.

  • false: Shutdown.

Ppv2VpcIdEnabled

Boolean

No

Yes

Specifies whether to use the Proxy Protocol to pass the VpcId to backend servers.

Valid values:

  • true: Enabled.

  • false means shutdown.

Tags syntax

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

Tags properties

Property name

Type

Required

Update allowed

Description

Constraints

Key

String

Yes

No

The tag key.

None

Value

String

No

No

The tag value.

None

Return value

Fn::GetAtt

  • ListenerPort: The frontend port used by the SLB instance.

  • ListenerId: The ID of the listener.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ServerGroupId:
    Type: String
    Description: ID of the ServerGroup
  LoadBalancerId:
    Type: String
    Description: ID of the LoadBalancer
  ListenerProtocol:
    Type: String
    AllowedValues:
      - TCP
      - UDP
      - TCPSSL
Resources:
  ExtensionResource:
    Type: ALIYUN::NLB::Listener
    Properties:
      ServerGroupId:
        Ref: ServerGroupId
      LoadBalancerId:
        Ref: LoadBalancerId
      ListenerProtocol:
        Ref: ListenerProtocol
Outputs:
  ListenerPort:
    Description: ListenerPort of created Listener
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ListenerPort
  ListenerId:
    Description: Id of created Listener
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ListenerId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ServerGroupId": {
      "Type": "String",
      "Description": "ID of the ServerGroup"
    },
    "LoadBalancerId": {
      "Type": "String",
      "Description": "ID of the LoadBalancer"
    },
    "ListenerProtocol": {
      "Type": "String",
      "AllowedValues": [
        "TCP",
        "UDP",
        "TCPSSL"
      ]
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::NLB::Listener",
      "Properties": {
        "ServerGroupId": {
          "Ref": "ServerGroupId"
        },
        "LoadBalancerId": {
          "Ref": "LoadBalancerId"
        },
        "ListenerProtocol": {
          "Ref": "ListenerProtocol"
        }
      }
    }
  },
  "Outputs": {
    "ListenerPort": {
      "Description": "ListenerPort of created Listener",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ListenerPort"
        ]
      }
    },
    "ListenerId": {
      "Description": "Id of created Listener",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ListenerId"
        ]
      }
    }
  }
}