Up-to-date reference of API arguments for ELB listener you can get at documentation portal
opentelekomcloud_lb_listener_v2¶
Manages an Enhanced LB listener resource within OpenTelekomCloud.
Example Basic Usage¶
resource "opentelekomcloud_lb_listener_v2" "listener_1" {
protocol = "HTTP"
protocol_port = 8080
loadbalancer_id = "d9415786-5f1a-428b-b35f-2f1523e146d2"
tags = {
muh = "kuh"
}
}
Example Ip Address Group¶
resource "opentelekomcloud_lb_loadbalancer_v2" "loadbalancer_1" {
name = "loadbalancer_1"
vip_subnet_id = data.opentelekomcloud_vpc_subnet_v1.shared_subnet.subnet_id
}
resource "opentelekomcloud_lb_ipgroup_v3" "group_1" {
name = "group_1"
description = "some interesting description 1"
ip_list {
ip = "192.168.10.10"
description = "first"
}
}
resource "opentelekomcloud_lb_listener_v2" "listener_1" {
name = "listener_1_updated"
loadbalancer_id = opentelekomcloud_lb_loadbalancer_v2.loadbalancer_1.id
protocol = "HTTP"
protocol_port = 8080
ip_group {
id = opentelekomcloud_lb_ipgroup_v3.group_1.id
enable = false
}
}
Argument Reference¶
The following arguments are supported:
protocol- (Required) The protocol - can either beTCP,HTTP,UDPorTERMINATED_HTTPS. Changing this creates a new Listener.protocol_port- (Required) The port on which to listen for client traffic. Changing this creates a new Listener.tenant_id- (Optional) Required for admins. The UUID of the tenant who owns the Listener. Only administrative users can specify a tenant UUID other than their own. Changing this creates a new Listener.loadbalancer_id- (Required) The load balancer on which to provision this Listener. Changing this creates a new Listener.name- (Optional) Human-readable name for the Listener. Does not have to be unique.default_pool_id- (Optional) The ID of the default pool with which the Listener is associated. Changing this creates a new Listener.description- (Optional) Human-readable description for the Listener.http2_enable- (Optional)trueto enable HTTP/2 mode of ELB. HTTP/2 is disabled by default if not set.default_tls_container_ref- (Optional) Specifies the ID of a certificate container of typeserverused by the listener. The value contains a maximum of 128 characters. The default value isnull. This parameter is required when protocol is set toTERMINATED_HTTPS. See here for more information.client_ca_tls_container_ref(Optional) Specifies the ID of a certificate container of typeclientused by the listener. The value contains a maximum of 128 characters. The default value isnull. The loadbalancer only establishes a TLS connection if the client presents a certificate delivered by the client CA whose certificate is registered in the referenced certificate container. The option is effective only in conjunction withTERMINATED_HTTPS.sni_container_refs- (Optional) Lists the IDs of SNI certificates (server certificates with a domain name) used by the listener. If the parameter value is an empty list, the SNI feature is disabled. The default value is[]. It only works in conjunction withTERMINATED_HTTPS.tls_ciphers_policy- (Optional) Controls the TLS version used. Supported values aretls-1-0,tls-1-1,tls-1-2andtls-1-2-strict. If not set, the loadbalancer usestls-1-0. See here for details about the supported cipher suites. The option is effective only in conjunction withTERMINATED_HTTPS.transparent_client_ip_enable- (Optional) Specifies whether to pass source IP addresses of the clients to backend servers. The value is alwaystrueforHTTPandHTTPSlisteners. ForTCPandUDPlisteners the value can betrueorfalsewithfalseby default.
->
If the load balancer is a Dedicated Load Balancer, transparent_client_ip_enable is always true
admin_state_up- (Optional) The administrative state of the Listener. A valid value istrue(UP) orfalse(DOWN).tags- (Optional) Tags key/value pairs to associate with the loadbalancer listener.ip_group- (Optional, Map) 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_listinopentelekomcloud_lb_ipgroup_v3is set to an empty array[]and type towhitelist, no IP addresses are allowed to access the listener. Ifip_listinopentelekomcloud_lb_ipgroup_v3is 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¶
The following attributes are exported:
id- The unique ID for the Listener.protocol- See Argument Reference above.protocol_port- See Argument Reference above.tenant_id- See Argument Reference above.name- See Argument Reference above.default_port_id- See Argument Reference above.description- See Argument Reference above.http2_enable- See Argument Reference above.default_tls_container_ref- See Argument Reference above.client_ca_tls_container_ref- See Argument Reference above.sni_container_refs- See Argument Reference above.tls_ciphers_policy- See Argument Reference above.admin_state_up- See Argument Reference above.tags- See Argument Reference above.
Import¶
Listeners can be imported using the id, e.g.
terraform import opentelekomcloud_lb_listener_v2.listener_1 7117d38e-4c8f-4624-a505-bd96b97d024c