Up-to-date reference of API arguments for DLB listener you can get at documentation portal
opentelekomcloud_lb_listener_v3¶
Manages a Dedicated LB listener resource within OpenTelekomCloud.
Example Usage¶
resource "opentelekomcloud_lb_listener_v3" "listener_1" {
protocol = "HTTP"
protocol_port = 8080
loadbalancer_id = var.loadbalancer_id
tags = {
muh = "kuh"
}
}
Example Ip Address Group¶
resource "opentelekomcloud_lb_ipgroup_v3" "group_1" {
name = "group_2"
description = "some interesting description 2"
ip_list {
ip = "192.168.10.11"
description = "one"
}
}
resource "opentelekomcloud_lb_listener_v3" "listener_1" {
name = "listener_1"
description = "some interesting description"
loadbalancer_id = opentelekomcloud_lb_loadbalancer_v3.loadbalancer_1.id
protocol = "HTTP"
protocol_port = 8080
advanced_forwarding = true
sni_match_algo = "wildcard"
insert_headers {
forwarded_host = true
}
ip_group {
id = opentelekomcloud_lb_ipgroup_v3.group_1.id
enable = true
}
}
Argument Reference¶
The following arguments are supported:
name
- (Optional, String) Specifies the listener name.description
- (Optional, String) Provides supplementary information about the listener.client_ca_tls_container_ref
- (Optional, String) Specifies the ID of the CA certificate used by the listener.default_pool_id
- (Optional, String) Specifies the ID of the default backend server group. If there is no matched forwarding policy, requests are forwarded to the default backend server for processing.default_tls_container_ref
- (Optional, String) Specifies the ID of the server certificate used by the listener.http2_enable
- (Optional, Bool) Specifies whether to use HTTP/2. This parameter is available only forHTTPS
listeners. If you configure this parameter for other types of listeners, it will not take effect. Enable HTTP/2 if you want the clients to use HTTP/2 to communicate with the load balancer. However, connections between the load balancer and backend servers use HTTP/1.x by default.insert_headers
- (Optional, List) Specifies the HTTP header fields.forward_elb_ip
- (Optional, Bool) Specifies whether to transparently transmit the load balancer EIP to backend servers. Ifforward_elb_ip
is set totrue
, the load balancer EIP will be stored in the HTTP header and passed to backend servers.forwarded_port
- (Optional, Bool) Specifies whether to transparently transmit the listening port of the load balancer to backend servers. Ifforwarded_port
is set totrue
, the listening port of the load balancer will be stored in the HTTP header and passed to backend servers.forwarded_for_port
- (Optional, Bool) Specifies whether to transparently transmit the source port of the client to backend servers. Ifforwarded_for_port
is set totrue
, the source port of the client will be stored in the HTTP header and passed to backend servers.forwarded_host
- (Optional, Bool) Specifies whether to rewrite theX-Forwarded-Host
header. Ifforwarded_host
is set totrue
,X-Forwarded-Host
in the request header from the clients can be set to Host in the request header sent from the load balancer to backend servers.
loadbalancer_id
- (Required, ForceNew, String) Specifies the ID of the load balancer that the listener is added to.protocol
- (Required, ForceNew, String) The protocol - can either beTCP
,HTTP
,HTTPS
orUDP
. Changing this creates a new Listener.protocol_port
- (Required, ForceNew, Int) Specifies the port used by the listener. Changing this creates a new Listener.sni_container_refs
- (Optional, List) Lists the IDs of SNI certificates (server certificates with domain names) used by the listener. Each SNI certificate can have up to 30 domain names, and each domain name in the SNI certificate must be unique. This parameter will be ignored and an empty array will be returned if the listener's protocol is notHTTPS
.tls_ciphers_policy
- (Optional, String) Specifies the security policy that will be used by the listener. This parameter is available only forHTTPS
listeners. An error will be returned if the protocol of the listener is notHTTPS
. Possible values are:tls-1-0
,tls-1-1
,tls-1-0-inherit
,tls-1-2
,tls-1-2-strict
,tls-1-2-fs
,tls-1-0-with-1-3
,tls-1-2-fs-with-1-3
,hybrid-policy-1-0
,tls-1-2-strict-no-cbc
.member_retry_enable
- (Optional, Bool) Specifies whether to enable health check retries for backend servers. This parameter is available only forHTTP
andHTTPS
listeners. An error will be returned if you configure this parameter forTCP
andUDP
listeners.keep_alive_timeout
- (Optional, Int) Specifies the idle timeout duration, in seconds.For
TCP
listeners, the value ranges from10
to4000
, and the default value is300
.For
HTTP
andHTTPS
listeners, the value ranges from0
to4000
, and the default value is60
.For
UDP
listeners, this parameter is not available. An error will be returned if you configure this parameter forUDP
listeners.
client_timeout
- (Optional, Int) Specifies the timeout duration for waiting for a request from a client, in seconds. This parameter is available only forHTTP
andHTTPS
listeners. The value ranges from1
to300
, and the default value is60
. An error will be returned if you configure this parameter forTCP
andUDP
listeners.member_timeout
- (Optional, Int) Specifies the timeout duration for waiting for a request from a backend server, in seconds. This parameter is available only forHTTP
andHTTPS
listeners. The value ranges from1
to300
, and the default value is60
. An error will be returned if you configure this parameter forTCP
andUDP
listeners.tags
- (Optional, ForceNew, Map) Tags key/value pairs to associate with the loadbalancer listener.advanced_forwarding
- (Optional, ForceNew, Bool) Specifies whether to enable advanced forwarding. If advanced forwarding is enabled, more flexible forwarding policies and rules are supported. The value can betrue
(enable advanced forwarding) orfalse
(disable advanced forwarding), and the default value isfalse
. Changing this creates a new Listener.sni_match_algo
- (Optional, String) Specifies how wildcard domain name matches with the SNI certificates used by the listener.security_policy_id
- (Optional, String) Specifies the ID of the custom security policy.ip_group
- (Optional, List) Specifies the IP address group associated with the listener.id
- (Required, String) Specifies the ID of the IP address group associated with the listener. Specifies the ID of the IP address group associated with the listener. Ifip_list
inopentelekomcloud_lb_ipgroup_v3
is set to an empty array[]
and type towhitelist
, no IP addresses are allowed to access the listener. Ifip_list
inopentelekomcloud_lb_ipgroup_v3
is set to an empty array[]
and type toblacklist
, any IP address is allowed to access the listener.enable
- (Optional, Bool) Specifies whether to enable access control.true
: Access control will be enabled.false
(default): Access control will be disabled.type
- (Optional, String) Specifies how access to the listener is controlled.white
(default): A whitelist will be configured. Only IP addresses in the whitelist can access the listener.black
: A blacklist will be configured. IP addresses in the blacklist are not allowed to access the listener.
Attributes Reference¶
In addition, the following attributes are exported:
updated_at
- Indicates the update time.created_at
- Indicates the creation time.
Import¶
Listeners can be imported using the id
, e.g.
terraform import opentelekomcloud_lb_listener_v3.listener_1 7117d38e-4c8f-4624-a505-bd96b97d024c