The DevHelm Terraform provider lets you manage monitors, alert channels, and other resources as infrastructure code alongside your cloud resources.
Install
Add the provider to your Terraform configuration:
terraform {
required_providers {
devhelm = {
source = "devhelmhq/devhelm"
}
}
}
provider "devhelm" {
api_token = var.devhelm_api_token # or DEVHELM_API_TOKEN env var
}
Resources
HTTP monitor
resource "devhelm_monitor" "api_health" {
name = "API Health"
type = "HTTP"
frequency_seconds = 60
regions = ["us-east", "eu-west"]
config {
url = "https://api.example.com/health"
method = "GET"
verify_tls = true
}
assertion {
type = "status_code"
expected = "200"
operator = "equals"
severity = "fail"
}
assertion {
type = "response_time"
threshold_ms = 2000
severity = "fail"
}
}
Alert channel
resource "devhelm_alert_channel" "slack" {
name = "Engineering Slack"
type = "SLACK"
config {
webhook_url = var.slack_webhook_url
mention_text = "@channel"
}
}
Tag
resource "devhelm_tag" "production" {
name = "production"
color = "#10b981"
}
Variables and outputs
variable "devhelm_api_token" {
type = string
sensitive = true
}
variable "slack_webhook_url" {
type = string
sensitive = true
}
output "monitor_id" {
value = devhelm_monitor.api_health.id
}
Import existing resources
Import resources created outside Terraform:
terraform import devhelm_monitor.api_health <monitor-id>
| Use case | Recommended tool |
|---|
| Monitors managed alongside cloud infra (AWS, GCP, etc.) | Terraform provider |
| Standalone monitoring config, fast iteration | devhelm.yml + CLI |
| CI/CD with GitHub Action | devhelm.yml + setup-devhelm action |
| Mixed infra — some Terraform, some standalone | Use both (avoid managing the same resource in both) |
Don’t manage the same resource with both Terraform and devhelm.yml. Pick one source of truth per resource to avoid drift and conflicts.
Next steps
Terraform monitors
Full devhelm_monitor resource reference.
YAML format
Alternative: manage monitors with YAML and the CLI.
Importing resources
Import existing resources into Terraform state.
Terraform in CI/CD
Automate Terraform plans and applies in CI.