Skip to main content
The devhelm_alert_channel resource creates and manages alert channel integrations in Terraform.

Basic example

resource "devhelm_alert_channel" "slack" {
  name         = "Engineering Slack"
  channel_type = "slack"
  webhook_url  = var.slack_webhook_url
  mention_text = "@channel"
}

Arguments

AttributeTypeRequiredDescription
namestringYesChannel display name (also used as import ID)
channel_typestringYesOne of 20 types: slack, email, pagerduty, opsgenie, discord, teams, webhook, telegram, google_chat, pushover, mattermost, splunk_oncall, pushbullet, linear, incident_io, rootly, zapier, datadog, jira, gitlab
webhook_urlstringIncoming webhook URL (required for slack, discord, teams, google_chat, mattermost, zapier)
mention_textstringSlack mention text (e.g., @channel)
mention_role_idstringDiscord role ID to mention
recipientslist(string)Email addresses (required for email)
routing_keystringRouting/integration key (required for pagerduty and splunk_oncall, sensitive)
severity_overridestringPagerDuty severity override
api_keystringService API key (required for opsgenie, splunk_oncall, linear, incident_io, rootly, datadog; sensitive)
regionstringOpsGenie region (us or eu)
urlstringEndpoint URL (required for webhook)
custom_headersmap(string)Custom HTTP headers for webhook delivery
signing_secretstringHMAC signing secret for webhook payloads (sensitive)
bot_tokenstringTelegram bot token from @BotFather (required for telegram, sensitive)
chat_idstringTelegram chat, group, or channel ID (required for telegram)
user_keystringPushover user or group key (required for pushover, sensitive)
app_tokenstringPushover application API token (required for pushover, sensitive)
prioritystringPushover notification priority override (-2 to 2)
soundstringPushover notification sound override
channelstringMattermost override channel (if webhook allows)
icon_urlstringCustom bot icon URL for Mattermost
access_tokenstringPushbullet access token (required for pushbullet, sensitive)
device_idenstringPushbullet target device (broadcasts to all if empty)
team_idstringLinear team ID to create issues in (required for linear)
label_idstringLinear label ID to attach to created issues
severity_idstringIncident.io severity ID for created incidents
visibilitystringIncident.io incident visibility: public or private
severitystringRootly severity slug override (e.g. sev0, sev1)
sitestringDatadog site region (e.g. datadoghq.com, datadoghq.eu)
tagsstringDatadog comma-separated tags to attach to events
domainstringAtlassian instance domain (required for jira)
emailstringAtlassian account email (required for jira)
api_tokenstringAtlassian API token (required for jira, sensitive)
project_keystringJira project key where issues are created (required for jira)
issue_typestringJira issue type name (e.g. Bug, Task, Incident)
endpoint_urlstringGitLab alert integration endpoint URL (required for gitlab)
authorization_keystringGitLab alert integration authorization key (required for gitlab, sensitive)
The provider enforces a per-type field matrix at plan time: attributes required by the chosen channel_type must be set, and attributes belonging to a different channel type are rejected with “Unsupported attribute for channel type” rather than silently dropped.

Computed attributes

AttributeDescription
idChannel ID
config_hashContent hash of the channel configuration

Examples by type

resource "devhelm_alert_channel" "slack" {
  name         = "Slack Alerts"
  channel_type = "slack"
  webhook_url  = var.slack_webhook_url
  mention_text = "@here"
}
resource "devhelm_alert_channel" "pagerduty" {
  name         = "PagerDuty On-Call"
  channel_type = "pagerduty"
  routing_key  = var.pagerduty_routing_key
}
resource "devhelm_alert_channel" "email" {
  name         = "Ops Email"
  channel_type = "email"
  recipients   = ["ops@example.com", "oncall@example.com"]
}
resource "devhelm_alert_channel" "webhook" {
  name           = "Custom Webhook"
  channel_type   = "webhook"
  url            = "https://hooks.example.com/devhelm"
  signing_secret = var.webhook_secret
  custom_headers = { "X-Source" = "devhelm" }
}

Import

terraform import devhelm_alert_channel.slack "Slack Alerts"
Import accepts the channel name or its UUID. If multiple channels share the same name, the import fails with an ambiguity error — import by UUID in that case.

Next steps

Monitors

Reference channels from monitor resources.

Integrations

Setup guides for each channel type.