最近更新时间:2025-03-18 20:13:33
提供一个负载均衡器规则资源。
provider "ksyun" {
}
resource "ksyun_lb_rule" "default" {
path = "/tfxun/update",
host_header_id = "",
backend_server_group_id=""
listener_sync="on"
method="RoundRobin"
session {
session_state = "start"
session_persistence_period = 1000
cookie_type = "ImplantCookie"
cookie_name = "cookiexunqq"
}
health_check{
health_check_state = "start"
healthy_threshold = 2
interval = 200
timeout = 2000
unhealthy_threshold = 2
url_path = "/monitor"
host_name = "www.ksyun.com"
}
}支持以下参数:
path - (必选)规则的路径。
host_header_id - (必选)主机头ID。
backend_server_group_id - (必选)后端服务器组的ID。
listener_sync - (必选)是否同步监听器的健康检查、会话保持和转发算法。有效值:‘on’, ‘off’。
method - (可选)监听器的转发模式。有效值:‘RoundRobin’, ‘LeastConnections’。
session_state - (可选)会话状态。有效值:‘start’, ‘stop’。
session_persistence_period - (可选)会话保持超时时间。有效值:1-86400。
cookie_type - (可选)Cookie的类型。有效值:‘ImplantCookie’, ‘RewriteCookie’。
cookie_name - (可选)Cookie的名称。当CookieType为’RewriteCookie’时,这个值是必填项;否则,这个值将被忽略。
timeout - (可选)健康检查超时时间。有效值:1-3600。
interval - (可选)健康检查间隔。有效值:1-3600。
health_check_state - (可选)健康检查状态。当ListenerSync为’off’时,这个值有效且可选;否则,这个值将被忽略。有效值:‘start’, ‘stop’。
healthy_threshold - (可选)健康阈值。当HealthCheckState为’start’时,这个值有效且必填;在其他情况下,这个值将被忽略。有效值:1-10。
unhealthy_threshold - (可选)不健康阈值。有效值:1-10。
url_path - (可选)HTTP类型监听器的健康检查链接。
host_name - (可选)HTTP类型健康检查的域名。
除了上述所有参数外,还导出以下属性:
create_time - 规则创建的时间。
rule_id - 规则的ID。
cookie_expiration_period - 会话保持超时时间。有效值:0-86400。
backend_server_group_id - 后端服务器组的ID。
listener_sync - 是否同步监听器的健康检查、会话保持和转发算法。有效值:‘on’, ‘off’。
method - 监听器的转发模式。有效值:‘RoundRobin’, ‘LeastConnections’。
session_state - 会话状态。有效值:‘start’, ‘stop’。
session_persistence_period - 会话保持超时时间。有效值:1-86400。
cookie_type - Cookie的类型。有效值:‘ImplantCookie’, ‘RewriteCookie’。
cookie_name - Cookie的名称。当CookieType为’RewriteCookie’时,这个值是必填项;否则,这个值将被忽略。
timeout - 健康检查超时时间。有效值:1-3600。
interval - 健康检查间隔。有效值:1-3600。
health_check_state - 健康检查状态。当ListenerSync为’off’时,这个值有效且可选;否则,这个值将被忽略。有效值:‘start’, ‘stop’。
healthy_threshold - 健康阈值。当HealthCheckState为’start’时,这个值有效且必填;在其他情况下,这个值将被忽略。有效值:1-10。
unhealthy_threshold - 不健康阈值。有效值:1-10。
url_path - HTTP类型监听器的健康检查链接。
host_name - HTTP类型健康检查的域名。
纯净模式
