Skip to main content
Get your first DevHelm monitor running with Terraform in 5 minutes.

Prerequisites

  • Terraform 1.5 or later
  • A DevHelm API token — create one from Settings → API Keys in the Dashboard
Set your token as an environment variable so the provider picks it up automatically:

1. Configure the provider

Create a main.tf file:
Initialize the working directory:
The provider reads DEVHELM_API_TOKEN from the environment. You can also set token directly in the provider block, but environment variables keep secrets out of your HCL files.

2. Create a monitor

Add an HTTP monitor resource to your main.tf:
config and assertions[].config are JSON strings, not HCL blocks. Use jsonencode({...}) with camelCase field names — they map directly to the API wire format.

3. Plan and apply

Preview what Terraform will create:
You should see one resource to add. Apply it:
Type yes to confirm. Your monitor is now live and checking every 60 seconds.

4. Add an alert channel

Wire up Slack (or any other channel) so you get notified when things break:
Link the alert channel to your monitor:
Run terraform apply again — the monitor now routes failures to your Slack channel.

5. Organize with tags

Import existing resources

Already have monitors in the dashboard? Import them into Terraform state by name:
See Importing resources for the full ID table.

Next steps

Provider overview

Full provider reference with all resources and data sources.

Monitor resource

Complete devhelm_monitor attribute reference.

Alert channels

Channel-type-specific Terraform arguments.

Terraform in CI/CD

Automate plans and applies in GitHub Actions or other CI systems.