Uptime monitoring as code with Terraform
Yes, OnlineOrNot works with Terraform. The onlineornot/onlineornot provider on the Terraform Registry manages uptime, browser, DNS and TCP checks, heartbeats, status pages, maintenance windows, webhooks, environment variables and API tokens. Review monitoring changes in pull requests and apply them from CI.
How to connect OnlineOrNot to Terraform
- Sign up for OnlineOrNot and create an API token with edit access to the resources Terraform will manage.
- Set the token in the
ONLINEORNOT_API_KEYenvironment variable. - Add
onlineornot/onlineornottorequired_providersand runterraform init. - Declare checks with resources such as
onlineornot_uptime_checkandonlineornot_browser_check, then runterraform planandterraform apply.
What you can manage with Terraform
onlineornot_uptime_check,onlineornot_dns_checkandonlineornot_tcp_check, with assertions, regions, intervals and alert settings.onlineornot_browser_check, from a URL or from a standalone Playwright Test file read withfile(). Deploy a folder of test files withfileset().onlineornot_heartbeatfor cron jobs and background workers.onlineornot_status_pageand its components, groups, incidents and scheduled maintenance.onlineornot_maintenance_window,onlineornot_webhook,onlineornot_environment_variableandonlineornot_token.
Frequently asked questions
Does OnlineOrNot work with Terraform?
Yes. OnlineOrNot has an official Terraform provider: use source = "onlineornot/onlineornot" in required_providers. The provider is generated from the same OpenAPI description as the OnlineOrNot API, so it keeps up with new API features.
Can I deploy Playwright tests with Terraform?
Yes. Write a standard @playwright/test file, run it locally, and set script = file("homepage.spec.js") on onlineornot_browser_check. Editing the file updates the same monitor. Each check takes one self-contained file: local imports, configuration files and extra dependencies are not uploaded.
Can Terraform route alerts to Slack, PagerDuty or Teams?
Yes. Connect the integration once in the dashboard, then list its ID in slack_alerts, oncall_alerts, microsoft_teams_alerts or another alert setting on each check or heartbeat.
Is there a TypeScript option?
Yes. Use the TypeScript SDK for scripts, or let Claude Code or Cursor set up monitoring for you. See monitoring as code.