Creates a listener for a Global Accelerator (GA) instance.
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
}
}
Properties
| Property | Type | Required | Update allowed | Description | Constraints |
| Description | String | No | Yes | The description of the listener. | None |
| PortRanges | List | Yes | Yes | The listening ports. | A maximum of 10 listening ports are supported. For more information, see the PortRanges property. |
| Protocol | String | Yes | Yes | The network transport protocol for the listener. | Valid values:
|
| AcceleratorId | String | Yes | No | The ID of the Global Accelerator instance. | None |
| 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 (-). |
| ClientAffinity | String | No | Yes | The client affinity setting. | Valid values:
|
| Certificates | List | No | Yes | The SSL certificate. | For more information, see the Certificates property. |
| SecurityPolicyId | String | No | Yes | The ID of the security policy. | Valid values:
Note This parameter is supported only by HTTPS listeners. |
| 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. |
| XForwardedForConfig | Map | No | Yes | XForward field configuration. | For more information, see the XForwardedForConfig property. |
Certificates syntax
"Certificates": [
{
"Id": String
}
]
Certificates properties
| Property Name | Type | Required | Update allowed | 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 Name | Type | Required | Update allowed | Description | Constraints |
| 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. |
| 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. |
| 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. |
| 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. |
PortRanges syntax
"PortRanges": [
{
"FromPort": Integer,
"ToPort": Integer
}
]
PortRanges properties
| Property name | Type | Required | Update allowed | 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 value
Fn::GetAtt
ListenerId: The ID of the listener.
Examples
-
JSONformat{ "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { "AcceleratorId": { "Type": "String", "Description": "The ID of the Global Accelerator instance to which the listener will be added." } }, "Resources": { "Listener": { "Type": "ALIYUN::GA::Listener", "Properties": { "PortRanges": [ { "FromPort": 336, "ToPort": 335 } ], "Protocol": "tcp", "AcceleratorId": { "Ref": "AcceleratorId" }, "Name": "TestListener", "ClientAffinity": "NONE" } } }, "Outputs": { "ListenerId": { "Description": "The ID of the listener.", "Value": { "Fn::GetAtt": [ "Listener", "ListenerId" ] } } } }
该文章对您有帮助吗?