🦞
Data Sources

openclaw_gateway

Reads the current OpenClaw gateway server configuration.

Reads the current gateway server configuration without managing it. Useful for cross-stack references where one Terraform config manages the gateway and another reads from it.

Example Usage

data "openclaw_gateway" "current" {}

output "gateway_port" {
  value = data.openclaw_gateway.current.port
}

output "auth_enabled" {
  value = data.openclaw_gateway.current.auth_mode != "none"
}

Conditional logic based on gateway config

data "openclaw_gateway" "current" {}

resource "openclaw_channel_whatsapp" "main" {
  # Only enable if gateway is bound to all interfaces
  count     = data.openclaw_gateway.current.bind == "all" ? 1 : 0
  dm_policy = "pairing"
}

Attribute Reference

AttributeTypeDescription
idStringAlways "gateway".
portInt64Gateway listen port.
bindStringBind address: loopback or all.
auth_modeStringAuthentication mode: token, password, or none.
reload_modeStringConfig reload mode: hybrid, hot, restart, or off.
tailscale_modeStringTailscale exposure mode: off, serve, or funnel.
modeStringGateway mode (e.g. local).

On this page