O recurso ALIYUN::GA::Listener cria um listener.
Sintaxe
{
"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
}
}
Propriedades
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrições |
|
AcceleratorId |
String |
Sim |
Não |
ID da instância do Global Accelerator. |
Nenhuma |
|
PortRanges |
List |
Sim |
Sim |
Portas de escuta. |
Suporta no máximo 10 portas de escuta. Para mais informações, consulte PortRanges property. |
|
Protocol |
String |
Sim |
Sim |
Protocolo de transporte de rede do listener. |
Valores válidos:
|
|
Certificates |
List |
Não |
Sim |
Certificado SSL. |
Para mais informações, consulte Certificates property. |
|
ClientAffinity |
String |
Não |
Sim |
Configuração de afinidade do cliente. |
Valores válidos:
|
|
Description |
String |
Não |
Sim |
Descrição do listener. |
Nenhuma |
|
HttpVersion |
String |
Não |
Sim |
Versão máxima do HTTP. |
Valores válidos:
Nota
Este parâmetro é suportado apenas por listeners HTTPS. |
|
IdleTimeout |
Integer |
Não |
Sim |
Tempo limite de conexão ociosa. |
Unidade: segundos. Valores válidos e padrões por protocolo:
|
|
Name |
String |
Não |
Sim |
Nome do listener. |
O nome deve ter entre 2 e 128 caracteres. Deve começar com uma letra ou caractere chinês. Pode conter letras, caracteres chineses, dígitos, sublinhados (_) e hifens (-). |
|
ProxyProtocol |
Boolean |
Não |
Sim |
Indica se o endereço IP de source do cliente deve ser preservado. |
Valores válidos:
Nota
Este parâmetro não será mais configurado pelas APIs de listener. Configure-o utilizando as APIs de grupos de endpoints. Para mais informações sobre o ProxyProtocol, consulte CreateEndpointGroup e UpdateEndpointGroup. |
|
RequestTimeout |
Integer |
Não |
Sim |
Tempo limite da solicitação. |
Unidade: segundos. Valores válidos: 1 a 180. Valor padrão: 60. Nota
Este parâmetro tem efeito apenas para listeners HTTP ou HTTPS. Se o servidor de backend não responder dentro do período de tempo limite, o Global Accelerator interrompe a espera e retorna HTTP 504 ao cliente. |
|
SecurityPolicyId |
String |
Não |
Sim |
ID da política de segurança. |
Valores válidos:
Nota
Este parâmetro é suportado apenas por listeners HTTPS. |
|
Type |
String |
Não |
Não |
Tipo de roteamento do listener. |
Valores válidos:
Nota
O recurso de listener com roteamento personalizado está em prévia. Para utilizar este recurso, entre em contato com o gerente de conta da Alibaba Cloud. Uma instância standard do Global Accelerator não suporta listeners de dois tipos de roteamento simultaneamente. O tipo de roteamento não pode ser alterado após a configuração do listener. |
|
XForwardedForConfig |
Map |
Não |
Sim |
Configuração do campo XForwardedFor. |
Para mais informações, consulte XForwardedForConfig properties. |
Sintaxe de Certificates
"Certificates": [
{
"Id": String
}
]
Propriedades de Certificates
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrições |
|
Id |
String |
Sim |
Sim |
ID do certificado SSL. |
Nota
Este parâmetro é obrigatório apenas para listeners HTTPS. |
Sintaxe de XForwardedForConfig
"XForwardedForConfig": {
"XRealIpEnabled": Boolean,
"XForwardedForGaIdEnabled": Boolean,
"XForwardedForGaApEnabled": Boolean,
"XForwardedForPortEnabled": Boolean,
"XForwardedForProtoEnabled": Boolean
}
Propriedades de XForwardedForConfig
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrições |
|
XForwardedForGaApEnabled |
Boolean |
Não |
Sim |
Indica se o cabeçalho GA-AP deve ser usado para obter informações da região de aceleração. |
Valores válidos:
Nota
Este parâmetro é suportado apenas por listeners HTTP e HTTPS. |
|
XForwardedForGaIdEnabled |
Boolean |
Não |
Sim |
Indica se o cabeçalho GA-ID deve ser usado para obter o ID da instância do Global Accelerator. |
Valores válidos:
Nota
Este parâmetro é suportado apenas por listeners HTTP e HTTPS. |
|
XForwardedForPortEnabled |
Boolean |
Não |
Sim |
Indica se o cabeçalho GA-X-Forward-Port deve ser usado para obter a porta de escuta da instância do Global Accelerator. |
Valores válidos:
Nota
Este parâmetro é suportado apenas por listeners HTTP e HTTPS. |
|
XForwardedForProtoEnabled |
Boolean |
Não |
Sim |
Indica se o cabeçalho GA-X-Forward-Proto deve ser usado para obter o protocolo de escuta da instância do Global Accelerator. |
Valores válidos:
Nota
Este parâmetro é suportado apenas por listeners HTTP e HTTPS. |
|
XRealIpEnabled |
Boolean |
Não |
Sim |
Indica se o cabeçalho X-Real-IP deve ser usado para obter os endereços IP reais dos clientes. |
Valores válidos:
Nota
Este parâmetro é suportado apenas por listeners HTTP e HTTPS. |
Sintaxe de PortRanges
"PortRanges": [
{
"FromPort": Integer,
"ToPort": Integer
}
]
Propriedades de PortRanges
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrições |
|
FromPort |
Integer |
Sim |
Sim |
Primeira porta no intervalo de portas de escuta usada para receber e encaminhar solicitações aos endpoints. |
Nenhuma |
|
ToPort |
Integer |
Sim |
Sim |
Última porta no intervalo de portas de escuta usada para receber e encaminhar solicitações aos endpoints. |
Nenhuma |
Valores de retorno
Fn::GetAtt
ListenerId: ID do listener.
Exemplos
Cenário 1: Crie um listener TCP para uma instância GA visando aceleração na camada 4.
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"
]
}
}
}
}Cenário 2: Crie um listener HTTP com configuração XForwardedFor para obter o IP real do cliente e informações de aceleração.
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"
]
}
}
}
}Cenário 3: Crie um listener HTTPS com certificado SSL e política de segurança TLS para aceleração global segura.
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"
]
}
}
}
}