Terraform Provider

Manage your Oack monitoring infrastructure as code with the official Terraform provider. Create teams, monitors, alert channels, status pages, and PagerDuty integrations — all in version-controlled HCL.

Installation

main.tf
terraform {
  required_providers {
    oack = {
      source  = "oack-io/oack"
      version = "~> 0.3"
    }
  }
}

provider "oack" {
  api_key    = var.oack_api_key    # or OACK_API_KEY env var
  account_id = var.oack_account_id # or OACK_ACCOUNT_ID env var
}

Available resources

ResourceDescription
oack_teamTeams that own monitors, channels, and API keys
oack_monitorHTTP/HTTPS monitors with SSL/domain expiry, latency thresholds, checker preferences
oack_alert_channelSlack, Email, Webhook, Telegram, Discord, PagerDuty channels
oack_monitor_alert_channel_linkRoute alerts from monitors to channels
oack_status_pagePublic or password-protected status pages with custom branding
oack_status_page_componentComponents and groups on status pages
oack_status_page_watchdogAuto-create/resolve incidents when monitors change health
oack_pagerduty_integrationTwo-way PagerDuty incident sync
oack_external_linkQuick links to Grafana, Datadog, or other dashboards
oack_team_api_keyTeam-scoped API keys for CI/CD and deploy events

Example: full-stack setup

main.tf
resource "oack_team" "production" {
  name = "Production"
}

resource "oack_monitor" "api" {
  team_id           = oack_team.production.id
  name              = "API Health"
  url               = "https://api.example.com/health"
  check_interval_ms = 30000
  ssl_expiry_enabled    = true
  domain_expiry_enabled = true
}

resource "oack_alert_channel" "slack" {
  team_id = oack_team.production.id
  name    = "Engineering Slack"
  type    = "slack"
  config  = jsonencode({ webhook_url = var.slack_webhook })
}

resource "oack_monitor_alert_channel_link" "api_slack" {
  team_id    = oack_team.production.id
  monitor_id = oack_monitor.api.id
  channel_id = oack_alert_channel.slack.id
}

See the full GitHub repository for progressive examples and resource documentation.