Add a contact point
A contact point defines where Grafana sends notifications when an alert fires. You can configure email, Slack, PagerDuty, webhooks, and many other integrations. For this path, you’ll create an email contact point.
To add a contact point, complete the following steps:
Add the following to your
alerts.tffile:resource "grafana_contact_point" "email_alerts" { name = "Email alerts" email { addresses = ["<YOUR_EMAIL_ADDRESS>"] } }Replace
<YOUR_EMAIL_ADDRESS>with your email address.
Alternative: Slack contact point
If you prefer Slack notifications, use the slack block instead:
resource "grafana_contact_point" "slack_alerts" {
name = "Slack alerts"
slack {
url = var.slack_webhook_url
title = "{{ .CommonLabels.alertname }}"
text = "{{ .CommonAnnotations.description }}"
}
}For the full list of supported integrations, refer to the grafana_contact_point resource documentation.
In the next milestone, you add a notification policy to route alerts to this contact point.