Provides a Global Accelerator (GA) Listener resource.
For information about Global Accelerator (GA) Listener and how to use it, see What is Listener.
Basic Usage
resource "alicloud_ga_accelerator" "default" {
duration = 1
auto_use_coupon = true
spec = "1"
}
resource "alicloud_ga_bandwidth_package" "default" {
bandwidth = 100
type = "Basic"
bandwidth_type = "Basic"
payment_type = "PayAsYouGo"
billing_type = "PayBy95"
ratio = 30
}
resource "alicloud_ga_bandwidth_package_attachment" "default" {
accelerator_id = alicloud_ga_accelerator.default.id
bandwidth_package_id = alicloud_ga_bandwidth_package.default.id
}
resource "alicloud_ga_listener" "default" {
accelerator_id = alicloud_ga_bandwidth_package_attachment.default.accelerator_id
port_ranges {
from_port = 80
to_port = 80
}
}
The following arguments are supported:
accelerator_id
- (Required, ForceNew) The accelerator id.protocol
- (Optional) Type of network transport protocol monitored. Default value: TCP
. Valid values: TCP
, UDP
, HTTP
, HTTPS
.proxy_protocol
- (Optional, Bool) The proxy protocol of the listener. Default value: false
. Valid values:
true
: Turn on the keep client source IP function. After it is turned on, the back-end service is supported to view the original IP address of the client.false
: Keep client source IP function is not turned on.security_policy_id
- (Optional, Available since v1.183.0) The ID of the security policy. NOTE: Only HTTPS
listeners support this parameter. Valid values:
tls_cipher_policy_1_0
:tls_cipher_policy_1_1
:tls_cipher_policy_1_2
:tls_cipher_policy_1_2_strict
:tls_cipher_policy_1_2_strict_with_1_3
:listener_type
- (Optional, ForceNew, Available since v1.196.0) The routing type of the listener. Default Value: Standard
. Valid values:
Standard
: intelligent routing.CustomRouting
: custom routing.http_version
- (Optional, Available since v1.220.0) The maximum version of the HTTP protocol. Default Value: http2
. Valid values: http1.1
, http2
, http3
.
certificates
The certificates supports the following:
id
- (Optional) The id of the certificate.port_ranges
The port_ranges supports the following:
from_port
- (Required, Int) The initial listening port used to receive requests and forward them to terminal nodes.to_port
- (Required, Int) The end listening port used to receive requests and forward them to terminal nodes.forwarded_for_config
The forwarded_for_config supports the following:
forwarded_for_ga_id_enabled
- (Optional, Bool) Specifies whether to use the GA-ID header to retrieve the ID of the GA instance. Default value: false
. Valid values:
true
: yes.false
: no.forwarded_for_ga_ap_enabled
- (Optional, Bool) Specifies whether to use the GA-AP header to retrieve the information about acceleration regions. Default value: false
. Valid values:
true
: yes.false
: no.forwarded_for_proto_enabled
- (Optional, Bool) Specifies whether to use the GA-X-Forward-Proto header to retrieve the listener protocol of the GA instance. Default value: false
. Valid values:
true
: yes.false
: no.forwarded_for_port_enabled
- (Optional, Bool) Specifies whether to use the GA-X-Forward-Port header to retrieve the listener ports of the GA instance. Default value: false
. Valid values:
true
: yes.false
: no.real_ip_enabled
- (Optional, Bool) Specifies whether to use the X-Real-IP header to retrieve client IP addresses. Default value: false
. Valid values:
true
: yes.false
: no.
The following attributes are exported:
id
- The resource ID in terraform of Listener.status
- The status of the listener.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 15 mins) Used when create the Listener.update
- (Defaults to 3 mins) Used when update the Listener.delete
- (Defaults to 10 mins) Used when delete the Listener.Ga Listener can be imported using the id, e.g.
$ terraform import alicloud_ga_listener.example <id>