Files
tf-infra/haproxy/frontend.tf
2026-03-14 20:56:04 +01:00

45 lines
959 B
HCL

resource "haproxy_backend" "backend_tf_test" {
name = "backend_tf_test"
mode = "http"
balance {
algorithm = "roundrobin"
}
httpchk_params {
uri = "/health"
version = "HTTP/1.1"
method = "GET"
}
forwardfor {
enabled = true
}
}
resource "haproxy_frontend" "front_tf_test" {
name = "front_tf_test"
backend = haproxy_backend.backend_tf_test.name
mode = "http"
compression {
algorithms = ["gzip", "identity"]
offload = true
types = ["text/html", "text/plain", "text/css", "application/javascript"]
}
forwardfor {
enabled = true
header = "X-Forwarded-For"
ifnone = true
}
}
resource "haproxy_bind" "bind_tf_test" {
name = "bind_test"
port = 8888
address = "0.0.0.0"
parent_name = haproxy_frontend.front_tf_test.name
parent_type = "frontend"
}