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,
"ProxyProtocolV2Config": Map
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
CaEnabled | Boolean | No | No | Specifies whether to enable mutual authentication. | Valid values:
|
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 newly created 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:
|
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 Proxy Protocol V2. | Valid values:
|
CertificateIds | List | No | No | The IDs of the certificates. | None. |
SecSensorEnabled | Boolean | No | No | Specifies whether to enable fine-grained monitoring. | Valid values:
|
Enable | Boolean | No | No | Specifies whether to enable the listener. | Valid values:
|
AlpnEnabled | Boolean | No | No | Specifies whether to enable ALPN. | Valid values:
|
Tags | List | No | Yes | The tags. | For more information, see Tags properties. |
ProxyProtocolV2Config | Map | No | No | Specifies whether to use Proxy Protocol to pass VpcId, PrivateLinkEpId, and PrivateLinkEpsId to backend servers. | For more information, see the "ProxyProtocolV2Config properties" section of this topic. |
ProxyProtocolV2Config syntax
"ProxyProtocolV2Config": {
"Ppv2PrivateLinkEpIdEnabled": Boolean,
"Ppv2PrivateLinkEpsIdEnabled": Boolean,
"Ppv2VpcIdEnabled": Boolean
}
ProxyProtocolV2Config properties
Property | Type | Required | Editable | Description | Constraint |
Ppv2PrivateLinkEpIdEnabled | Boolean | No | No | Specifies whether to use Proxy Protocol to pass PrivateLinkEpId to backend servers. | Valid values:
|
Ppv2PrivateLinkEpsIdEnabled | Boolean | No | No | Specifies whether to use Proxy Protocol to pass PrivateLinkEpsId to backend servers. | Valid values:
|
Ppv2VpcIdEnabled | Boolean | No | No | Specifies whether to use Proxy Protocol to pass VpcId to backend servers. | Valid values:
|
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"
]
}
}
}
}