Manage Honeybadger with Terraform
Honeybadger now has its own Terraform provider. You can define a project, its uptime checks, check-ins, alarms, and alert integrations in code, review them in a pull request, and stand up a new app's Honeybadger config with one terraform apply.
The provider is on the Terraform Registry as honeybadger-io/honeybadger. It has 43 resources:
- Projects, environments, and ingestion keys
- Uptime checks and check-ins
- Insights alarms and dashboards
- Teams and status pages
- 34 integrations, including Slack, PagerDuty, GitHub, Jira, Linear, Microsoft Teams, Opsgenie, Discord, Zulip, email, and webhooks
Getting started
Create a v3 API token under My settings → API Access for a personal token, or Account → Settings & billing → API Access for an account token. Give it the scopes for the resources you'll manage. Creating a project, as the example below does, also needs projects:create. Then export the token:
export HONEYBADGER_API_TOKEN="your-api-token"
Add the provider and a few resources:
terraform {
required_providers {
honeybadger = {
source = "honeybadger-io/honeybadger"
version = "~> 0.1"
}
}
}
provider "honeybadger" {}
resource "honeybadger_project" "app" {
name = "My App"
language = "ruby"
}
resource "honeybadger_check_in" "nightly" {
project_id = honeybadger_project.app.id
name = "Nightly billing"
report_period = "1 day"
grace_period = "10 minutes"
}
resource "honeybadger_site" "api" {
project_id = honeybadger_project.app.id
url = "https://api.example.com/health"
locations = ["Virginia", "Frankfurt"]
match_type = "include"
match = "ok"
}
For an EU account, set api_url = "https://eu-app.honeybadger.io" in the provider block. Then run terraform init and terraform apply.
Resources also expose the values your app needs, such as an ingestion key and a check-in's report_url. Ingestion key values are marked sensitive, so an output that returns one needs sensitive = true.
Import what you already have
Every resource supports terraform import, so you can bring your existing Honeybadger config into Terraform without rebuilding it. With Terraform 1.5 or later, use an import block:
import {
to = honeybadger_project.app
id = "Xk9mZp"
}
terraform plan -generate-config-out=generated.tf writes a starting config for imported objects that don't have a resource block yet.
Once a resource is in Terraform, a change someone makes in the Honeybadger UI to a setting you manage shows up in the next terraform plan, and terraform apply reverts it to match your config.
To learn more, see the Terraform guide in the Honeybadger docs. It links to the full provider reference on the Terraform Registry and working examples of each resource.
Try Honeybadger for FREE
Honeybadger is full-stack application monitoring that helps developers move fast and fix things. Get set up in minutes and check monitoring off your to-do list.
Easy 5-minute setup — No credit card required