Back to blog
· 3 min read

OkStatus Now Supports Terraform

Define uptime monitors, heartbeat checks, and status pages as code. The OkStatus Terraform provider is now available.

OK

OkStatus Team

terraformproductinfrastructure-as-code

Managing monitoring through a dashboard doesn't scale. You click around, create monitors, forget what you configured, and eventually your monitoring setup drifts from reality. Your infrastructure is in Terraform. Your monitoring should be too.

Today we're releasing the OkStatus Terraform provider.

Define monitors as code

terraform {
  required_providers {
    okstatus = {
      source  = "okstatushq/okstatus"
      version = "~> 1.0"
    }
  }
}

provider "okstatus" { api_key = var.okstatus_api_key }

resource "okstatus_monitor" "api" { name = "Production API" kind = "http"

check_config = { url = "https://api.example.com/health" method = "get" interval_sec = 60 timeout_ms = 5000 }

alerting = { channels = [okstatus_channel.slack.id] } }

This monitor lives in your repo. It goes through code review. It deploys with your infrastructure. When someone asks "what are we monitoring?" the answer is in Git.

Heartbeats work too

resource "okstatus_heartbeat" "nightly_backup" {
  name              = "Nightly Backup"
  expected_interval = "24h"
  grace_period      = "30m"

alerting = { channels = [okstatus_channel.pagerduty.id] } }

Your cron jobs and background tasks get the same treatment. Define the heartbeat in Terraform, add a curl to your job, done.

Status pages follow

resource "okstatus_status_page" "public" {
  name   = "status.example.com"
  public = true

monitors = [ okstatus_monitor.api.id, okstatus_monitor.web.id, ] }

Your status page configuration is now version controlled. Add a monitor to the page by adding a line. Remove it the same way.

Getting started

The provider is available on the Terraform Registry. Full documentation is available there, including all supported resources and data sources.

The provider is included in all Team plans, and available during early access at $29/month.

Your infrastructure is code. Now your monitoring is too.

Ready to get started?

Create your first monitor in under a minute. No credit card required.

Start for free