Up-to-date reference of API arguments for DLB pool you can get at documentation portal
opentelekomcloud_lb_pool_v3¶
Manages a Dedicated LB pool resource within OpenTelekomCloud.
Example Usage¶
resource "opentelekomcloud_lb_loadbalancer_v3" "lb" {
name = "loadbalancer_1"
router_id = var.router_id
network_ids = [var.network_id]
availability_zones = [var.availability_zone]
}
resource "opentelekomcloud_lb_pool_v3" "pool" {
name = "pool_1"
loadbalancer_id = opentelekomcloud_lb_loadbalancer_v3.lb.id
lb_algorithm = "ROUND_ROBIN"
protocol = "TCP"
session_persistence {
type = "SOURCE_IP"
persistence_timeout = "30"
}
}
Argument Reference¶
The following arguments are supported:
name
- (Optional) Specifies the backend server group name.description
- (Optional) Provides supplementary information about the backend server group.protocol
- (Required) Specifies the protocol used by the backend server group to receive requests.TCP
,UDP
,HTTP
,HTTPS
, andQUIC
are supported.For
UDP
listeners, the protocol of the backend server group must beUDP
.For
TCP
listeners, the protocol of the backend server group must beTCP
.For
HTTP
listeners, the protocol of the backend server group must beHTTP
.For
HTTPS
listeners, the protocol of the backend server group must beHTTPS
.
lb_algorithm
- (Required) Specifies the load balancing algorithm used by the load balancer to route requests to backend servers.The value can be one of the following:
ROUND_ROBIN
: weighted round-robinLEAST_CONNECTIONS
: weighted least connectionsSOURCE_IP
: source IP hash
When the value is
SOURCE_IP
, the weights of backend servers are invalid.listener_id
- (Optional) Specifies the ID of the listener associated with the backend server group.loadbalancer_id
- (Optional) Specifies the ID of the associated load balancer.
-> Specify either listener_id
or loadbalancer_id
, or both of them.
project_id
- (Optional) Specifies the project ID.session_persistence
- (Optional) Specifies whether to enable sticky sessions.
The session_persistence
block supports:
type
- (Required) Specifies the sticky session type. The value can beSOURCE_IP
,HTTP_COOKIE
, orAPP_COOKIE
.If the protocol of the backend server group is
TCP
,UDP
, andQUIC
, onlySOURCE_IP
takes effect.For dedicated load balancers, if the protocol of the backend server group is
HTTP
orHTTPS
, the value can only beHTTP_COOKIE
.For shared load balancers, if the protocol of the backend server group is
HTTP
orHTTPS
, the value can beHTTP_COOKIE
orAPP_COOKIE
.
cookie_name
- (Optional) Specifies the cookie name. This parameter will take effect only when type is set toAPP_COOKIE
. The value can contain only letters, digits, hyphens (-), underscores (_), and periods (.).persistence_timeout
- (Optional) Specifies the stickiness duration, in minutes. This parameter will not take effect when type is set toAPP_COOKIE
.If the protocol of the backend server group is TCP or UDP, the value ranges from
1
to60
, and the default value is1
.If the protocol of the backend server group is HTTP or HTTPS, the value ranges from
1
to1440
, and the default value is1440
.
member_deletion_protection
- (Optional) Specifies whether to enable removal protection for the pool members.true
: Enable removal protection.false
(default): Disable removal protection.vpc_id
- (Optional) Specifies the ID of the VPC where the backend server group works.type
- (Optional) Specifies the type of the backend server group.
Attributes Reference¶
In addition to all arguments above, the following attributes are exported:
id
- Specifies the backend server group ID.ip_version
- Specifies the IP version supported by the backend server group.
Import¶
Pools can be imported using the id
, e.g.
terraform import opentelekomcloud_lb_pool_v3.pool 7b80e108-1636-44e5-aece-986b0052b7dd