All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::NLB::Listener

Last Updated:Apr 28, 2024

ALIYUN::NLB::Listener is used 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
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

CaEnabled

Boolean

No

No

Specifies whether to enable mutual authentication.

Valid values:

  • true

  • false (default)

ListenerPort

Integer

No

No

The frontend port that is used by the Network Load Balancer (NLB) instance.

Valid values: 1 to 65535.

StartPort

Integer

No

No

The start port in the listening port range.

Set the value to 1.

Cps

Integer

No

No

The number of new connections per second (CPS).

Set the value to 3000.

ServerGroupId

String

Yes

No

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

None.

IdleTimeout

Integer

No

No

The timeout period of an idle connection.

Valid values: 1 to 60. Unit: seconds.

LoadBalancerId

String

Yes

No

The ID of the NLB instance.

None.

Mss

Integer

No

No

The Maximum Segment Size (MSS) announcement.

None.

ListenerProtocol

String

Yes

No

The frontend protocol that is used by the NLB instance.

Valid values:

  • TCP

  • UDP

  • TCPSSL

SecurityPolicyId

String

No

No

The ID of the security policy.

None.

ListenerDescription

String

No

No

The description of the listener.

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

AlpnPolicy

String

No

No

The Application-Layer Protocol Negotiation (ALPN) policy.

None.

CaCertificateIds

List

No

No

The IDs of the certificate authority (CA) certificates.

None.

EndPort

Integer

No

No

The end port in the listening port range.

Set the value to 65535.

ProxyProtocolEnabled

Boolean

No

No

Specifies whether to enable the proxy protocol version 2.

Valid values:

  • true

  • false

CertificateIds

List

No

No

The IDs of the certificates.

None.

SecSensorEnabled

Boolean

No

No

Specifies whether to enable fine-grained monitoring.

Valid values:

  • true

  • false

Enable

Boolean

No

No

Specifies whether to enable the listener.

Valid values:

  • true

  • false

AlpnEnabled

Boolean

No

No

Specifies whether to enable ALPN.

Valid values:

  • true

  • false

Tags

List

No

Yes

The tags.

For more information, see Tags properties.

Tags syntax

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

Tags properties

Property

Type

Required

Editable

Description

Constraint

Key

String

Yes

No

The tag key.

None.

Value

String

No

No

The tag value.

None.

Return values

Fn::GetAtt

  • ListenerPort: the frontend port that is used by the NLB instance.

  • ListenerId: the listener ID.

Examples

YAML format

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

JSON format

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