Skip to content

kupe_alertmanager_global

Manages the global section of the Alertmanager configuration for a tenant. Singleton — only one of these resources should exist per tenant.

# Singleton-per-tenant Alertmanager global section. Use this to set SMTP
# defaults, slack_api_url, resolve_timeout, and other top-level fields shared
# by every receiver in the tenant.
#
# See https://prometheus.io/docs/alerting/latest/configuration/#configuration-file
# for the complete field list.
resource "kupe_alertmanager_global" "main" {
body_json = jsonencode({
smtp_from = "alerts@example.com"
smtp_smarthost = "smtp.example.com:587"
smtp_auth_username = "alerts@example.com"
smtp_auth_password = var.smtp_password
resolve_timeout = "5m"
})
}
variable "smtp_password" {
type = string
sensitive = true
}
  • body_json (String) Alertmanager global section as a JSON document. Use HCL’s jsonencode() to author. See the upstream Alertmanager docs for the field list.
  • etag (String) Wrapper ETag from the most recent read or write. Used for optimistic locking.
  • id (String) Always equal to a singleton constant. Singleton-per-tenant resource.

Import is supported using the following syntax:

The terraform import command can be used, for example:

Terminal window
terraform import kupe_alertmanager_global.main alertmanager-global