Skip to content

kupe_alertmanager_receiver

Manages a single notification receiver in the tenant’s notification configuration. Receivers are referenced by routes via their name. The body is provided as a JSON document via jsonencode() so any receiver type supported by Kupe (slack_configs, email_configs, webhook_configs, pagerduty_configs, msteams_configs, etc.) can be used without a provider upgrade.

resource "kupe_alertmanager_receiver" "slack" {
name = "slack"
body_json = jsonencode({
slack_configs = [{
api_url = var.slack_webhook_url
channel = "#alerts"
send_resolved = true
title = "[{{ .Status | toUpper }}] {{ .CommonLabels.alertname }}"
text = "{{ range .Alerts }}{{ .Annotations.summary }}\n{{ end }}"
}]
})
}
resource "kupe_alertmanager_receiver" "pagerduty" {
name = "pagerduty"
body_json = jsonencode({
pagerduty_configs = [{
service_key = var.pagerduty_service_key
send_resolved = true
}]
})
}
variable "slack_webhook_url" {
type = string
sensitive = true
}
variable "pagerduty_service_key" {
type = string
sensitive = true
}
  • body_json (String, Sensitive) notification receiver body as a JSON document. Use HCL’s jsonencode() to author the value. The name field is set automatically from the resource name attribute and any value embedded in the body is overridden. Marked sensitive because receiver bodies routinely embed credentials (Slack webhook URLs, PagerDuty service keys, SMTP passwords); the value is still stored in plaintext in your Terraform state, so back the state with an encrypted remote backend.
  • name (String) Receiver name. Immutable after creation; rename requires destroy + create.
  • etag (String) Wrapper ETag from the most recent read or write. Used for optimistic locking on subsequent updates to detect concurrent edits from the Console UI or other API clients.

Import is supported using the following syntax:

The terraform import command can be used, for example:

Terminal window
terraform import kupe_alertmanager_receiver.slack slack