Checkly Terraform provider

Your infrastructure is in Terraform. Put your monitors there too.

The Checkly provider adds checks, groups, alert channels, status pages, and private locations to the HCL you already review, plan, and apply. Same pull request, same state, same pipeline as the services they watch.

checks.tfcheckly/checkly ~> 1.0
1resource "checkly_check" "orders_api" {
2 name = "GET /v1/orders"
3 type = "API"
4 activated = true
5 frequency = 1
6 use_global_alert_settings = true
7 degraded_response_time = 3000
8 max_response_time = 10000
9 locations = ["eu-central-1", "us-east-1"]
10 tags = ["checkout", "terraform"]
11
12 retry_strategy {
13 type = "LINEAR"
14 max_retries = 2
15 same_region = false
16 }
17
18 request {
19 url = "https://api.acme.dev/v1/orders"
20 follow_redirects = true
21
22 assertion {
23 source = "STATUS_CODE"
24 comparison = "EQUALS"
25 target = "200"
26 }
27
28 assertion {
29 source = "JSON_BODY"
30 property = "$.orders"
31 comparison = "NOT_EMPTY"
32 }
33 }
34}

Trusted by engineering teams that manage everything as code

Vercel
Carhartt
CrowdStrike
Airbus
Fanatics
Mistral
ServiceNow
GoFundMe
Hopper
1Password
Fastly
Total Wine
“We chose Checkly because of the Terraform provider that was available out of the box. Another important thing for us was the fact that we could automate the generation of the checks from Terraform.”
Alessio Casco·Head of DevOps, TrueLayer

Your app's code lives in source control. Your monitoring should too.

Monitoring configured by hand drifts behind the product. Monitoring declared in Terraform ships with the release, rolls back with the release, and documents itself in the process.

terraform plan

Monitors show up in the same diff as the service

A new endpoint and the check that watches it land in one pull request. Reviewers see the assertion next to the route, and terraform plan tells everyone what changes before anything runs.

terraform state

State owns the lifecycle

Rename a check, move it into a group, or delete the service it covered, and apply reconciles the account to match. No orphaned monitors paging for an API that no longer exists.

checkly_*

The whole setup, not just checks

Groups, alert channels, status pages, dashboards, maintenance windows, private locations, snippets, and environment variables are all resources. One apply stands up the full account.

Resources in the provider

checkly_checkcheckly_check_groupcheckly_alert_channelcheckly_playwright_check_suitecheckly_url_monitorcheckly_tcp_monitorcheckly_dns_monitorcheckly_icmp_monitorcheckly_heartbeat_monitorcheckly_status_pagecheckly_dashboardcheckly_maintenance_windowscheckly_private_locationcheckly_snippetcheckly_environment_variablefull list on the registry →
“Everything scaffolds out based on a configuration, so we just update a configuration file which specifies the environments, what services are there, what the URLs are, and from that, we just generate all the groups and their checks.”
Tobias Deekens·Principal Frontend Engineer, commercetools

Get started in three steps

From an empty folder to a running check in one apply. Or clone the getting-started repository and skip the typing.

01

Add the provider

Pin checkly/checkly from the Terraform Registry and pass your credentials through variables, so nothing sensitive lands in the repo.

main.tf
1terraform {
2 required_providers {
3 checkly = {
4 source = "checkly/checkly"
5 version = "~> 1.0"
6 }
7 }
8}
9
10variable "checkly_api_key" {}
11variable "checkly_account_id" {}
12
13provider "checkly" {
14 api_key = var.checkly_api_key
15 account_id = var.checkly_account_id
16}
02

Export your credentials

A user API key and the target account ID, both from your Checkly settings. TF_VAR_ prefixes feed them straight into the variables above.

shell
# User API key: app.checklyhq.com/settings/user/api-keys
$ export TF_VAR_checkly_api_key=cu_xxx
# Account ID: app.checklyhq.com/settings/account/general
$ export TF_VAR_checkly_account_id=xxx
03

Init and apply

terraform init installs the provider. terraform apply shows the plan, waits for your yes, and creates the resources in your Checkly account.

shell
$ terraform init
Initializing provider plugins...
- Finding checkly/checkly versions matching "~> 1.0"...
- Installing checkly/checkly v1.28.0...
- Installed checkly/checkly v1.28.0 (signed by a HashiCorp partner)
Terraform has been successfully initialized!
$ terraform apply
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Only 'yes' will be accepted to approve.
Enter a value: yes
checkly_check.orders_api: Creating...
checkly_check.orders_api: Creation complete after 1s [id=cc143901-fbae-4942-91fe-4b99b0250567]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Terraform or the Checkly CLI?

Both are monitoring as code against the same account. The honest answer depends on where the rest of your configuration already lives.

npx checkly deploy

The Checkly CLI

The primary path. Monitors are TypeScript constructs next to your Playwright tests, you run them against any environment with npx checkly test before they deploy, and the project layout is built for monitoring first.

Start here if monitoring is a new codebase for your team. Monitoring as code with the CLI

terraform apply

The Terraform provider

For teams whose infrastructure is already declared in Terraform. Monitors join the same state, the same plan, and the same pipeline, and the Playwright scripts they run still test locally with npx playwright test.

Pick one owner per resource. Checkly resources should be managed either through Terraform or through the UI, not both.

One apply away from monitored

Add the provider, export two variables, and your first check is running from the plan you just reviewed. No credit card required.