The StatusDrift Terraform provider lets you manage your monitoring configuration as code. You can use it to create and update monitors, alerts, status pages, incidents, SLA policies, API keys, and other related resources from your Terraform workflow.
If you want the complete schema and the latest supported resources, start with the StatusDrift provider documentation in the Terraform Registry. This guide focuses on the quickest path to a working setup.
Create an API key
Open Account Settings, go to API Keys, and create a key for Terraform. The provider expects an API key that starts with sdk_. Treat this key like any other secret and avoid committing it to source control.

Create an API key in Account Settings before you authenticate the Terraform provider.
Install the provider
Add the provider to your Terraform configuration. The provider source is apptlysoft/statusdrift. You can optionally add a version constraint if you want to pin your environment to a specific release.
terraform {
required_providers {
statusdrift = {
source = "apptlysoft/statusdrift"
}
}
}
provider "statusdrift" {}
Authenticate with your API key
The simplest approach is to pass the key through the STATUSDRIFT_API_KEY environment variable before you run Terraform. That keeps the secret out of your Terraform files.
export STATUSDRIFT_API_KEY="sdk_your_api_key_here"
If you prefer, the provider also supports api_key and api_url in the provider block. The full authentication options are documented in the Registry.
Create your first resource
This example creates a basic HTTPS monitor. It is intentionally minimal, so you can confirm the provider is working before you add alerts, tags, monitor groups, or status page resources.
resource "statusdrift_monitor" "homepage" {
name = "Homepage"
type = "HTTPS"
url = "https://statusdrift.com/"
interval = 5
enabled = true
location_type = "region"
region = "us-east-1"
http_method = "GET"
expected_status_code = "200"
}
Run Terraform
Initialize the provider, review the plan, and apply the configuration:
terraform init
terraform plan
terraform apply
After the apply completes, refresh your StatusDrift dashboard to confirm the new monitor was created.
Where to go next
- Browse the full provider documentation for supported resources and data sources.
- Use Terraform variables or your CI secret store instead of hardcoding credentials in
.tffiles. - Expand from a single monitor to alerts, status pages, incidents, and SLA policies once the provider is part of your regular workflow.