How to manage Uptimecheck with Terraform

Updated November 15, 2026 3 min read

On Professional and Business, the Uptimecheck provider for Terraform, uptimecheck-com/uptimecheck in the Terraform Registry, manages monitors, projects, alert channels and status pages as code. It works through the REST API with an API key.

Create an API key

  1. Open Settings in the sidebar and choose the API tab.
  2. Choose New API key, name it after where it is used, such as “Terraform”, and pick Read & write. The provider creates and changes things, so a read-only key isn’t enough.
  3. Choose Create key and copy it. This is the only time the key is shown.

Add the provider

Add the provider to your configuration:

terraform {
  required_providers {
    uptimecheck = {
      source = "uptimecheck-com/uptimecheck"
    }
  }
}

provider "uptimecheck" {}

Run terraform init, which downloads the provider from the Terraform Registry. Then put the key in the UPTIMECHECK_API_KEY environment variable, for example with export UPTIMECHECK_API_KEY=uc_your_api_key, or as a secret in your CI system. The provider also takes an api_key argument, but the environment variable keeps the key out of your files.

Add a monitor

resource "uptimecheck_monitor" "checkout" {
  type             = "http"
  name             = "Checkout"
  target           = "https://shop.example.com/checkout"
  interval_seconds = 60
  config = jsonencode({
    expectedStatus = "200-299"
    keyword        = { value = "Add to cart", mode = "contains" }
    slowMs         = 1500
  })
}
  • type is one of http, tcp, ping, dns, domain, heartbeat, server, vendor, crawl and flow. Changing it replaces the monitor.
  • config holds the type’s settings as JSON, with the same keys as the API reference. Only the keys you write are managed, so the app’s defaults for the rest don’t show up as changes.
  • interval_seconds is how often to check, from 60 to 3600 seconds (30 on a plan that allows it), 300 if you leave it out.
  • channel_ids picks the alert channels, project_id the project, and paused = true pauses the monitor.

Run terraform plan to see what will change, then terraform apply. The monitor shows up in the app right away.

A cron job and its ping URL

resource "uptimecheck_monitor" "backup" {
  type = "heartbeat"
  name = "Nightly backup"
  config = jsonencode({
    schedule      = { cron = "0 3 * * *", timeZone = "Europe/Stockholm" }
    graceSeconds  = 900
    maxRunSeconds = 3600
  })
}

output "backup_ping_url" {
  value     = uptimecheck_monitor.backup.heartbeat_url
  sensitive = true
}

The ping URL is in heartbeat_url, marked sensitive. Read it with terraform output -raw backup_ping_url and add it to the job.

Projects, alert channels and status pages

  • uptimecheck_project: a project, such as a client, with a name and a color. Deleting it leaves its monitors and status pages without a project; its client reports and client access are deleted with it.
  • uptimecheck_alert_channel: email, Slack by incoming webhook, Microsoft Teams, Discord, Google Chat, Mattermost, PagerDuty, ntfy, Pushover and webhooks. The address or key goes in config, which the API never returns, so a change made in the app isn’t seen as drift. delay_minutes (5, 10, 15, 30 or 60) makes it an escalation step. A webhook’s signing secret is in webhook_secret, returned only when the channel is created.
  • uptimecheck_status_page: a status page with its title, look and components, the monitors visitors see, in order and optionally grouped. Its password, email access list and custom CSS are set in the app and left alone. Deleting it deletes its subscribers, written updates and visitor statistics.
  • Data sources uptimecheck_alert_channels, uptimecheck_projects and uptimecheck_status_pages list what exists. Use the first for SMS, Telegram, push and Add to Slack channels, which are set up in the app.

Bring in what you already have

Monitors, projects, alert channels and status pages made in the app can be imported by their ID:

terraform import uptimecheck_monitor.checkout mon_...
terraform import uptimecheck_project.acme prj_...
terraform import uptimecheck_alert_channel.slack ch_...
terraform import uptimecheck_status_page.public sp_...

An imported alert channel’s address and a webhook’s signing secret aren’t read back. Every resource and attribute is documented in the Terraform Registry. More on the Terraform integration, API keys and the REST API.

Integration Terraform

Was this article helpful?

Try it in your own workspace

14-day free trial · Then free on 20 monitors · No credit card

Still stuck?

Email support@uptimecheck.com and we will reply within 24 hours.

Automating it? The API reference covers the REST API, webhooks, cron job pings and MCP.