Skip to content

stackit_loadbalancer: support HTTP health checks, alt_port and labels #1825

Open

Description

@ibrahimyesilay

Problem description

The Network Load Balancer API supports HTTP health checks, an alternative health check port and labels, but stackit_loadbalancer doesn't expose them:

  • targetPools[].activeHealthCheck.altPort and targetPools[].activeHealthCheck.httpHealthChecks (path, okStatuses) — the provider only exposes healthy_threshold, interval, interval_jitter, timeout and unhealthy_threshold, so every NLB health check is a plain TCP check on the target port.
  • labels on the load balancer (create and update payload).

All of these are already available in stackit-sdk-go/services/loadbalancer/v2api (ActiveHealthCheck.AltPort, ActiveHealthCheck.HttpHealthChecks, CreateLoadBalancerPayload.Labels / UpdateLoadBalancerPayload.Labels), and stackit_application_load_balancer already supports the same health check options (alt_port, http_health_checks.path, http_health_checks.ok_status) and labels.

Proposed solution

Add the same attributes to stackit_loadbalancer (resource and data source), following the ALB implementation:

resource "stackit_loadbalancer" "example" {
  # ...
  labels = {
    env = "dev"
  }

  target_pools = [{
    name        = "example-pool"
    target_port = 80
    targets     = [{ display_name = "example", ip = "192.168.0.10" }]

    active_health_check = {
      healthy_threshold   = 3
      interval            = "10s"
      interval_jitter     = "3s"
      timeout             = "3s"
      unhealthy_threshold = 3
      alt_port            = 8080
      http_health_checks = {
        path      = "/healthz"
        ok_status = ["200"]
      }
    }
  }]
}

I'd like to implement this and would split it into two PRs: health check options (alt_port, http_health_checks) first, then labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions