ALIYUN::GA::Listener creates a listener.
Syntax
{
"Type": "ALIYUN::GA::Listener",
"Properties": {
"Description": String,
"PortRanges": List,
"Protocol": String,
"AcceleratorId": String,
"Name": String,
"ClientAffinity": String,
"Certificates": List,
"SecurityPolicyId": String,
"ProxyProtocol": Boolean,
"XForwardedForConfig": Map,
"RequestTimeout": Integer,
"IdleTimeout": Integer,
"HttpVersion": String,
"Type": String
}
}
Properties
|
Property |
Type |
Required |
Editable |
Description |
Constraints |
|
AcceleratorId |
String |
Yes |
No |
The ID of the Global Accelerator instance. |
None |
|
PortRanges |
List |
Yes |
Yes |
The listening ports. |
A maximum of 10 listening ports are supported. For more information, see PortRanges property. |
|
Protocol |
String |
Yes |
Yes |
The network transport protocol for the listener. |
Valid values:
|
|
Certificates |
List |
No |
Yes |
The SSL certificate. |
For more information, see Certificates property. |
|
ClientAffinity |
String |
No |
Yes |
The client affinity setting. |
Valid values:
|
|
Description |
String |
No |
Yes |
The description of the listener. |
None |
|
HttpVersion |
String |
No |
Yes |
The maximum HTTP version. |
Valid values:
Note
This parameter is supported only by HTTPS listeners. |
|
IdleTimeout |
Integer |
No |
Yes |
The idle connection timeout period. |
Unit: seconds. Valid values and defaults by protocol:
|
|
Name |
String |
No |
Yes |
The name of the listener. |
The name must be 2 to 128 characters long. It must start with a letter or a Chinese character. It can contain letters, Chinese characters, digits, underscores (_), and hyphens (-). |
|
ProxyProtocol |
Boolean |
No |
Yes |
Whether to preserve the source IP address of the client. |
Valid values:
Note
This parameter will no longer be configured using listener APIs. Configure this parameter using the APIs for endpoint groups. For more information about ProxyProtocol, see CreateEndpointGroup and UpdateEndpointGroup. |
|
RequestTimeout |
Integer |
No |
Yes |
The request timeout period. |
Unit: seconds. Valid values: 1 to 180. Default value: 60. Note
This parameter takes effect only for HTTP or HTTPS listeners. If the backend server does not respond within the timeout period, Global Accelerator stops waiting and returns HTTP 504 to the client. |
|
SecurityPolicyId |
String |
No |
Yes |
The ID of the security policy. |
Valid values:
Note
This parameter is supported only by HTTPS listeners. |
|
Type |
String |
No |
No |
The routing type of the listener. |
Valid values:
Note
The custom routing listener feature is in preview. To use this feature, contact your Alibaba Cloud account manager. A standard Global Accelerator instance does not support listeners of two routing types at the same time. The routing type cannot be changed after the listener is configured. |
|
XForwardedForConfig |
Map |
No |
Yes |
XForward field configuration. |
For more information, see XForwardedForConfig properties. |
Certificates syntax
"Certificates": [
{
"Id": String
}
]
Certificates properties
|
Property |
Type |
Required |
Editable |
Description |
Constraints |
|
Id |
String |
Yes |
Yes |
The ID of the SSL certificate. |
Note
This parameter is required only for HTTPS listeners. |
XForwardedForConfig syntax
"XForwardedForConfig": {
"XRealIpEnabled": Boolean,
"XForwardedForGaIdEnabled": Boolean,
"XForwardedForGaApEnabled": Boolean,
"XForwardedForPortEnabled": Boolean,
"XForwardedForProtoEnabled": Boolean
}
XForwardedForConfig properties
|
Property |
Type |
Required |
Editable |
Description |
Constraints |
|
XForwardedForGaApEnabled |
Boolean |
No |
Yes |
Whether to use the GA-AP header to retrieve the acceleration region information. |
Valid values:
Note
This parameter is supported only by HTTP and HTTPS listeners. |
|
XForwardedForGaIdEnabled |
Boolean |
No |
Yes |
Whether to use the GA-ID header to retrieve the ID of the Global Accelerator instance. |
Valid values:
Note
This parameter is supported only by HTTP and HTTPS listeners. |
|
XForwardedForPortEnabled |
Boolean |
No |
Yes |
Whether to use the GA-X-Forward-Port header to retrieve the listening port of the Global Accelerator instance. |
Valid values:
Note
This parameter is supported only by HTTP and HTTPS listeners. |
|
XForwardedForProtoEnabled |
Boolean |
No |
Yes |
Whether to use the GA-X-Forward-Proto header to retrieve the listening protocol of the Global Accelerator instance. |
Valid values:
Note
This parameter is supported only by HTTP and HTTPS listeners. |
|
XRealIpEnabled |
Boolean |
No |
Yes |
Whether to use the X-Real-IP header to retrieve the real IP addresses of clients. |
Valid values:
Note
This parameter is supported only by HTTP and HTTPS listeners. |
PortRanges syntax
"PortRanges": [
{
"FromPort": Integer,
"ToPort": Integer
}
]
PortRanges properties
|
Property |
Type |
Required |
Editable |
Description |
Constraints |
|
FromPort |
Integer |
Yes |
Yes |
The first port in the listening port range used to receive and forward requests to endpoints. |
None |
|
ToPort |
Integer |
Yes |
Yes |
The last port in the listening port range used to receive and forward requests to endpoints. |
None |
Return values
Fn::GetAtt
-
ListenerId: The ID of the listener.
Examples
Scenario 1: Create a TCP listener for a GA instance for Layer-4 acceleration.
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 为全球加速实例创建TCP监听,用于四层协议加速。
en: Create a TCP listener for a GA instance for Layer-4 acceleration.
Parameters:
AcceleratorId:
Type: String
Label:
zh-cn: 全球加速实例ID
en: Accelerator ID
Description:
zh-cn: 已有的全球加速实例ID。
en: The ID of an existing Global Accelerator instance.
ListenerName:
Type: String
Label:
zh-cn: 监听名称
en: Listener Name
Description:
zh-cn: >-
监听器的名称,2~128个字符,
以字母或汉字开头。
en: >-
Listener name, 2-128 characters,
starting with a letter or Chinese character.
Default: tcp-listener
FromPort:
Type: Number
Label:
zh-cn: 起始监听端口
en: From Port
Description:
zh-cn: 监听端口范围的起始端口。
en: The start port of the listening port range.
Default: 9000
MinValue: 1
MaxValue: 65499
ToPort:
Type: Number
Label:
zh-cn: 结束监听端口
en: To Port
Description:
zh-cn: 监听端口范围的结束端口,与起始端口相同时表示监听单个端口。
en: The end port of the listening port range. Same as from-port for a single port.
Default: 9000
MinValue: 1
MaxValue: 65499
Resources:
Listener:
Type: ALIYUN::GA::Listener
Properties:
AcceleratorId:
Ref: AcceleratorId
Name:
Ref: ListenerName
Protocol: tcp
PortRanges:
- FromPort:
Ref: FromPort
ToPort:
Ref: ToPort
ClientAffinity: SOURCE_IP
Outputs:
ListenerId:
Label:
zh-cn: 监听ID
en: Listener ID
Description:
zh-cn: 创建成功的监听器唯一标识。
en: The unique identifier of the created listener.
Value:
Fn::GetAtt:
- Listener
- ListenerId{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "为全球加速实例创建TCP监听,用于四层协议加速。",
"en": "Create a TCP listener for a GA instance for Layer-4 acceleration."
},
"Parameters": {
"AcceleratorId": {
"Type": "String",
"Label": {
"zh-cn": "全球加速实例ID",
"en": "Accelerator ID"
},
"Description": {
"zh-cn": "已有的全球加速实例ID。",
"en": "The ID of an existing Global Accelerator instance."
}
},
"ListenerName": {
"Type": "String",
"Label": {
"zh-cn": "监听名称",
"en": "Listener Name"
},
"Description": {
"zh-cn": "监听器的名称,2~128个字符,以字母或汉字开头。",
"en": "Listener name, 2-128 characters, starting with a letter or Chinese character."
},
"Default": "tcp-listener"
},
"FromPort": {
"Type": "Number",
"Label": {
"zh-cn": "起始监听端口",
"en": "From Port"
},
"Description": {
"zh-cn": "监听端口范围的起始端口。",
"en": "The start port of the listening port range."
},
"Default": 9000,
"MinValue": 1,
"MaxValue": 65499
},
"ToPort": {
"Type": "Number",
"Label": {
"zh-cn": "结束监听端口",
"en": "To Port"
},
"Description": {
"zh-cn": "监听端口范围的结束端口,与起始端口相同时表示监听单个端口。",
"en": "The end port of the listening port range. Same as from-port for a single port."
},
"Default": 9000,
"MinValue": 1,
"MaxValue": 65499
}
},
"Resources": {
"Listener": {
"Type": "ALIYUN::GA::Listener",
"Properties": {
"AcceleratorId": {
"Ref": "AcceleratorId"
},
"Name": {
"Ref": "ListenerName"
},
"Protocol": "tcp",
"PortRanges": [
{
"FromPort": {
"Ref": "FromPort"
},
"ToPort": {
"Ref": "ToPort"
}
}
],
"ClientAffinity": "SOURCE_IP"
}
}
},
"Outputs": {
"ListenerId": {
"Label": {
"zh-cn": "监听ID",
"en": "Listener ID"
},
"Description": {
"zh-cn": "创建成功的监听器唯一标识。",
"en": "The unique identifier of the created listener."
},
"Value": {
"Fn::GetAtt": [
"Listener",
"ListenerId"
]
}
}
}
}Scenario 2: Create an HTTP listener with XForwardedFor config to obtain the client real IP and acceleration information.
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建HTTP监听并配置XForwardedFor头,获取客户端真实IP和加速信息。
en: Create an HTTP listener with XForwardedFor config for client IP and GA info.
Parameters:
AcceleratorId:
Type: String
Label:
zh-cn: 全球加速实例ID
en: Accelerator ID
Description:
zh-cn: 已有的全球加速实例ID。
en: The ID of an existing Global Accelerator instance.
ListenerName:
Type: String
Label:
zh-cn: 监听名称
en: Listener Name
Description:
zh-cn: 监听器的名称。
en: The name of the listener.
Default: http-listener
Resources:
Listener:
Type: ALIYUN::GA::Listener
Properties:
AcceleratorId:
Ref: AcceleratorId
Name:
Ref: ListenerName
Description: HTTP listener with XForwardedFor enabled to obtain client and acceleration information.
Protocol: http
PortRanges:
- FromPort: 80
ToPort: 80
- FromPort: 8080
ToPort: 8080
ClientAffinity: NONE
XForwardedForConfig:
XRealIpEnabled: true
XForwardedForGaIdEnabled: true
XForwardedForGaApEnabled: true
XForwardedForPortEnabled: true
XForwardedForProtoEnabled: true
Outputs:
ListenerId:
Label:
zh-cn: 监听ID
en: Listener ID
Description:
zh-cn: 创建成功的HTTP监听器唯一标识。
en: The unique identifier of the created HTTP listener.
Value:
Fn::GetAtt:
- Listener
- ListenerId{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "创建HTTP监听并配置XForwardedFor头,获取客户端真实IP和加速信息。",
"en": "Create an HTTP listener with XForwardedFor config for client IP and GA info."
},
"Parameters": {
"AcceleratorId": {
"Type": "String",
"Label": {
"zh-cn": "全球加速实例ID",
"en": "Accelerator ID"
},
"Description": {
"zh-cn": "已有的全球加速实例ID。",
"en": "The ID of an existing Global Accelerator instance."
}
},
"ListenerName": {
"Type": "String",
"Label": {
"zh-cn": "监听名称",
"en": "Listener Name"
},
"Description": {
"zh-cn": "监听器的名称。",
"en": "The name of the listener."
},
"Default": "http-listener"
}
},
"Resources": {
"Listener": {
"Type": "ALIYUN::GA::Listener",
"Properties": {
"AcceleratorId": {
"Ref": "AcceleratorId"
},
"Name": {
"Ref": "ListenerName"
},
"Description": "HTTP listener with XForwardedFor enabled to obtain client and acceleration information.",
"Protocol": "http",
"PortRanges": [
{
"FromPort": 80,
"ToPort": 80
},
{
"FromPort": 8080,
"ToPort": 8080
}
],
"ClientAffinity": "NONE",
"XForwardedForConfig": {
"XRealIpEnabled": true,
"XForwardedForGaIdEnabled": true,
"XForwardedForGaApEnabled": true,
"XForwardedForPortEnabled": true,
"XForwardedForProtoEnabled": true
}
}
}
},
"Outputs": {
"ListenerId": {
"Label": {
"zh-cn": "监听ID",
"en": "Listener ID"
},
"Description": {
"zh-cn": "创建成功的HTTP监听器唯一标识。",
"en": "The unique identifier of the created HTTP listener."
},
"Value": {
"Fn::GetAtt": [
"Listener",
"ListenerId"
]
}
}
}
}Scenario 3: Create an HTTPS listener with an SSL certificate and a TLS security policy for secure global acceleration.
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建HTTPS监听并配置SSL证书和TLS安全策略,实现安全的全球加速。
en: Create an HTTPS listener with SSL certificate and TLS security policy.
Parameters:
AcceleratorId:
Type: String
Label:
zh-cn: 全球加速实例ID
en: Accelerator ID
Description:
zh-cn: 已有的全球加速实例ID。
en: The ID of an existing Global Accelerator instance.
ListenerName:
Type: String
Label:
zh-cn: 监听名称
en: Listener Name
Description:
zh-cn: HTTPS监听器的名称。
en: The name of the HTTPS listener.
Default: https-listener
CertificateId:
Type: String
Label:
zh-cn: SSL证书ID
en: SSL Certificate ID
Description:
zh-cn: >-
SSL证书的唯一标识,可在SSL证书服务控制台获取。
证书需与加速域名匹配。
en: >-
The SSL certificate ID, available in the SSL Certificates Service console.
The certificate must match the accelerated domain.
SecurityPolicyId:
Type: String
Label:
zh-cn: TLS安全策略
en: TLS Security Policy
Description:
zh-cn: >-
TLS安全策略,决定支持的TLS版本和加密算法套件。
tls_cipher_policy_1_2_strict_with_1_3:TLSv1.2+1.3,最高安全性(推荐)。
tls_cipher_policy_1_2_strict:仅TLSv1.2严格模式。
tls_cipher_policy_1_2:TLSv1.2标准模式。
tls_cipher_policy_1_0:TLSv1.0+1.1+1.2,兼容性最佳。
en: >-
TLS security policy controlling supported TLS versions and cipher suites.
tls_cipher_policy_1_2_strict_with_1_3: TLSv1.2+1.3, highest security (recommended).
Default: tls_cipher_policy_1_2_strict_with_1_3
AllowedValues:
- tls_cipher_policy_1_2_strict_with_1_3
- tls_cipher_policy_1_2_strict
- tls_cipher_policy_1_2
- tls_cipher_policy_1_1
- tls_cipher_policy_1_0
ClientAffinity:
Type: String
Label:
zh-cn: 客户端亲和性
en: Client Affinity
Description:
zh-cn: >-
SOURCE_IP:保持客户端亲和性,来自同一客户端的请求始终转发到同一终端节点。
NONE:不保持亲和性,请求可能转发到不同终端节点。
en: >-
SOURCE_IP: maintain client affinity, same client always goes to same endpoint.
NONE: no affinity, requests may go to different endpoints.
Default: SOURCE_IP
AllowedValues:
- SOURCE_IP
- NONE
Resources:
Listener:
Type: ALIYUN::GA::Listener
Properties:
AcceleratorId:
Ref: AcceleratorId
Name:
Ref: ListenerName
Description: HTTPS secure listener with an SSL certificate and a TLS security policy configured.
Protocol: https
PortRanges:
- FromPort: 443
ToPort: 443
ClientAffinity:
Ref: ClientAffinity
Certificates:
- Id:
Ref: CertificateId
SecurityPolicyId:
Ref: SecurityPolicyId
XForwardedForConfig:
XRealIpEnabled: true
XForwardedForGaIdEnabled: true
XForwardedForGaApEnabled: false
XForwardedForPortEnabled: true
XForwardedForProtoEnabled: true
Outputs:
ListenerId:
Label:
zh-cn: 监听ID
en: Listener ID
Description:
zh-cn: 创建成功的HTTPS监听器唯一标识。
en: The unique identifier of the created HTTPS listener.
Value:
Fn::GetAtt:
- Listener
- ListenerId{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "创建HTTPS监听并配置SSL证书和TLS安全策略,实现安全的全球加速。",
"en": "Create an HTTPS listener with SSL certificate and TLS security policy."
},
"Parameters": {
"AcceleratorId": {
"Type": "String",
"Label": {
"zh-cn": "全球加速实例ID",
"en": "Accelerator ID"
},
"Description": {
"zh-cn": "已有的全球加速实例ID。",
"en": "The ID of an existing Global Accelerator instance."
}
},
"ListenerName": {
"Type": "String",
"Label": {
"zh-cn": "监听名称",
"en": "Listener Name"
},
"Description": {
"zh-cn": "HTTPS监听器的名称。",
"en": "The name of the HTTPS listener."
},
"Default": "https-listener"
},
"CertificateId": {
"Type": "String",
"Label": {
"zh-cn": "SSL证书ID",
"en": "SSL Certificate ID"
},
"Description": {
"zh-cn": "SSL证书的唯一标识,可在SSL证书服务控制台获取。证书需与加速域名匹配。",
"en": "The SSL certificate ID, available in the SSL Certificates Service console. The certificate must match the accelerated domain."
}
},
"SecurityPolicyId": {
"Type": "String",
"Label": {
"zh-cn": "TLS安全策略",
"en": "TLS Security Policy"
},
"Description": {
"zh-cn": "TLS安全策略,决定支持的TLS版本和加密算法套件。tls_cipher_policy_1_2_strict_with_1_3:TLSv1.2+1.3,最高安全性(推荐)。tls_cipher_policy_1_2_strict:仅TLSv1.2严格模式。tls_cipher_policy_1_2:TLSv1.2标准模式。tls_cipher_policy_1_0:TLSv1.0+1.1+1.2,兼容性最佳。",
"en": "TLS security policy controlling supported TLS versions and cipher suites. tls_cipher_policy_1_2_strict_with_1_3: TLSv1.2+1.3, highest security (recommended)."
},
"Default": "tls_cipher_policy_1_2_strict_with_1_3",
"AllowedValues": [
"tls_cipher_policy_1_2_strict_with_1_3",
"tls_cipher_policy_1_2_strict",
"tls_cipher_policy_1_2",
"tls_cipher_policy_1_1",
"tls_cipher_policy_1_0"
]
},
"ClientAffinity": {
"Type": "String",
"Label": {
"zh-cn": "客户端亲和性",
"en": "Client Affinity"
},
"Description": {
"zh-cn": "SOURCE_IP:保持客户端亲和性,来自同一客户端的请求始终转发到同一终端节点。NONE:不保持亲和性,请求可能转发到不同终端节点。",
"en": "SOURCE_IP: maintain client affinity, same client always goes to same endpoint. NONE: no affinity, requests may go to different endpoints."
},
"Default": "SOURCE_IP",
"AllowedValues": [
"SOURCE_IP",
"NONE"
]
}
},
"Resources": {
"Listener": {
"Type": "ALIYUN::GA::Listener",
"Properties": {
"AcceleratorId": {
"Ref": "AcceleratorId"
},
"Name": {
"Ref": "ListenerName"
},
"Description": "HTTPS secure listener with an SSL certificate and a TLS security policy configured.",
"Protocol": "https",
"PortRanges": [
{
"FromPort": 443,
"ToPort": 443
}
],
"ClientAffinity": {
"Ref": "ClientAffinity"
},
"Certificates": [
{
"Id": {
"Ref": "CertificateId"
}
}
],
"SecurityPolicyId": {
"Ref": "SecurityPolicyId"
},
"XForwardedForConfig": {
"XRealIpEnabled": true,
"XForwardedForGaIdEnabled": true,
"XForwardedForGaApEnabled": false,
"XForwardedForPortEnabled": true,
"XForwardedForProtoEnabled": true
}
}
}
},
"Outputs": {
"ListenerId": {
"Label": {
"zh-cn": "监听ID",
"en": "Listener ID"
},
"Description": {
"zh-cn": "创建成功的HTTPS监听器唯一标识。",
"en": "The unique identifier of the created HTTPS listener."
},
"Value": {
"Fn::GetAtt": [
"Listener",
"ListenerId"
]
}
}
}
}