» ucloud_lb_listener
Provides a Load Balancer Listener resource.
» Example Usage
resource "ucloud_lb" "web" {
name = "tf-example-lb"
tag = "tf-example"
}
resource "ucloud_lb_listener" "example" {
load_balancer_id = "${ucloud_lb.web.id}"
protocol = "https"
}
» Argument Reference
The following arguments are supported:
-
load_balancer_id
- (Required) The ID of load balancer instance. -
protocol
- (Required) Listener protocol. Possible values:http
,https
,tcp
iflisten_type
isrequest_proxy
,tcp
andudp
iflisten_type
ispackets_transmit
. -
name
- (Optional) The name of the listener. If not specified, terraform will autogenerate a name beginning withtf-lb-listener
. -
listen_type
- (Optional) The type of listener. Possible values arerequest_proxy
andpackets_transmit
. (Default:request_proxy
). -
port
- (Optional) Port opened on the listeners to receive requests, range: 1-65535. (Default:80
). -
idle_timeout
- (Optional) Amount of time in seconds to wait for the response for in between two sessions iflisten_type
isrequest_proxy
, range: 0-86400. (Default:60
). Amount of time in seconds to wait for one session iflisten_type
ispackets_transmit
, range: 60-900. The session will be closed as soon as no response if it is0
. -
method
- (Optional) The load balancer method in which the listener is. Possible values are:roundrobin
,source
,consistent_hash
,source_port
,consistent_hash_port
,weight_roundrobin
andleastconn
. (Default:roundrobin
).- The
consistent_hash
,source_port
,consistent_hash_port
,roundrobin
,source
andweight_roundrobin
are valid iflisten_type
ispackets_transmit
. - The
roundrobin
,source
andweight_roundrobin
andleastconn
are vaild iflisten_type
isrequest_proxy
.
- The
-
persistence
- (Optional) Indicate whether the persistence session is enabled, it is invaild ifpersistence_type
isnone
, an auto-generated string will be exported ifpersistence_type
isserver_insert
, a custom string will be exported ifpersistence_type
isuser_defined
. -
persistence_type
- (Optional) The type of session persistence of listener. Possible values are:none
as disabled,server_insert
as auto-generated string anduser_defined
as cutom string. (Default:none
). -
health_check_type
- (Optional) Health check method. Possible values areport
as port checking andpath
as http checking. -
path
- (Optional) Health check path checking. -
domain
- (Optional) Health check domain checking.
» Attributes Reference
In addition to all arguments above, the following attributes are exported:
-
status
- Listener status. Possible values are:allNormal
for all resource functioning well,partNormal
for partial resource functioning well andallException
for all resource functioning exceptional.
» Import
LB Listener can be imported using the id
, e.g.
$ terraform import ucloud_lb_listener.example vserver-abcdefg