🦞
Data Sources

openclaw_health

Reads the gateway health status.

Reads the health status of a running OpenClaw gateway. Requires WebSocket mode -- will return an error in file mode.

Example Usage

data "openclaw_health" "gw" {}

output "gateway_ok" {
  value = data.openclaw_health.gw.ok
}

output "default_agent" {
  value = data.openclaw_health.gw.default_agent_id
}

Use as a precondition

data "openclaw_health" "gw" {}

resource "openclaw_gateway" "main" {
  port = 18789

  lifecycle {
    precondition {
      condition     = data.openclaw_health.gw.ok
      error_message = "Gateway health check failed."
    }
  }
}

Attribute Reference

AttributeTypeDescription
idStringAlways "health".
okBoolWhether the gateway health check passed.
timestampInt64Server timestamp (Unix milliseconds) when health was checked.
default_agent_idStringThe default agent ID configured on the gateway.
heartbeat_secondsInt64Heartbeat interval in seconds.

On this page