Manages Grafana Alerting contact points.
This resource requires Grafana 9.1.0 or later.
resource "grafana_contact_point" "my_contact_point" {
name = "My Contact Point"
email {
addresses = ["one@company.org", "two@company.org"]
message = "{{ len .Alerts.Firing }} firing."
subject = "{{ template \"default.title\" .}}"
single_email = true
disable_resolve_message = false
}
}
name
(String) The name of the contact point.alertmanager
(Block Set) A contact point that sends notifications to other Alertmanager instances. (see below for nested schema)dingding
(Block Set) A contact point that sends notifications to DingDing. (see below for nested schema)disable_provenance
(Boolean) Allow modifying the contact point from other sources than Terraform or the Grafana API. Defaults to false
.discord
(Block Set) A contact point that sends notifications as Discord messages (see below for nested schema)email
(Block Set) A contact point that sends notifications to an email address. (see below for nested schema)googlechat
(Block Set) A contact point that sends notifications to Google Chat. (see below for nested schema)kafka
(Block Set) A contact point that publishes notifications to Apache Kafka topics. (see below for nested schema)line
(Block Set) A contact point that sends notifications to LINE.me. (see below for nested schema)oncall
(Block Set) A contact point that sends notifications to Grafana On-Call. (see below for nested schema)opsgenie
(Block Set) A contact point that sends notifications to OpsGenie. (see below for nested schema)org_id
(String) The Organization ID. If not set, the Org ID defined in the provider block will be used.pagerduty
(Block Set) A contact point that sends notifications to PagerDuty. (see below for nested schema)pushover
(Block Set) A contact point that sends notifications to Pushover. (see below for nested schema)sensugo
(Block Set) A contact point that sends notifications to SensuGo. (see below for nested schema)slack
(Block Set) A contact point that sends notifications to Slack. (see below for nested schema)sns
(Block Set) A contact point that sends notifications to Amazon SNS. Requires Amazon Managed Grafana. (see below for nested schema)teams
(Block Set) A contact point that sends notifications to Microsoft Teams. (see below for nested schema)telegram
(Block Set) A contact point that sends notifications to Telegram. (see below for nested schema)threema
(Block Set) A contact point that sends notifications to Threema. (see below for nested schema)victorops
(Block Set) A contact point that sends notifications to VictorOps (now known as Splunk OnCall). (see below for nested schema)webex
(Block Set) A contact point that sends notifications to Cisco Webex. (see below for nested schema)webhook
(Block Set) A contact point that sends notifications to an arbitrary webhook, using the Prometheus webhook format defined here: https://prometheus.io/docs/alerting/latest/configuration/#webhook_config (see below for nested schema)wecom
(Block Set) A contact point that sends notifications to WeCom. (see below for nested schema)id
(String) The ID of this resource.alertmanager
Required:
url
(String) The URL of the Alertmanager instance.Optional:
basic_auth_password
(String, Sensitive) The password component of the basic auth credentials to use.basic_auth_user
(String) The username component of the basic auth credentials to use.disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.Read-Only:
uid
(String) The UID of the contact point.dingding
Required:
url
(String) The DingDing webhook URL.Optional:
disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.message
(String) The templated content of the message.message_type
(String) The format of message to send - either 'link' or 'actionCard'settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.title
(String) The templated title of the message.Read-Only:
uid
(String) The UID of the contact point.discord
Required:
url
(String, Sensitive) The discord webhook URL.Optional:
avatar_url
(String) The URL of a custom avatar image to use. Defaults to ``.disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.message
(String) The templated content of the message. Defaults to ``.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.title
(String) The templated content of the title.use_discord_username
(Boolean) Whether to use the bot account's plain username instead of "Grafana." Defaults to false
.Read-Only:
uid
(String) The UID of the contact point.email
Required:
addresses
(List of String) The addresses to send emails to.Optional:
disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.message
(String) The templated content of the email. Defaults to ``.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.single_email
(Boolean) Whether to send a single email CC'ing all addresses, rather than a separate email to each address. Defaults to false
.subject
(String) The templated subject line of the email. Defaults to ``.Read-Only:
uid
(String) The UID of the contact point.googlechat
Required:
url
(String, Sensitive) The Google Chat webhook URL.Optional:
disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.message
(String) The templated content of the message.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.title
(String) The templated content of the title.Read-Only:
uid
(String) The UID of the contact point.kafka
Required:
rest_proxy_url
(String, Sensitive) The URL of the Kafka REST proxy to send requests to.topic
(String) The name of the Kafka topic to publish to.Optional:
api_version
(String) The API version to use when contacting the Kafka REST Server. Supported: v2 (default) and v3. Defaults to v2
.cluster_id
(String) The Id of cluster to use when contacting the Kafka REST Server. Required api_version to be 'v3'description
(String) The templated description of the Kafka message.details
(String) The templated details to include with the message.disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.password
(String, Sensitive) The password to use when making a call to the Kafka REST Proxysettings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.username
(String) The user name to use when making a call to the Kafka REST ProxyRead-Only:
uid
(String) The UID of the contact point.line
Required:
token
(String, Sensitive) The bearer token used to authorize the client.Optional:
description
(String) The templated description of the message.disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.title
(String) The templated title of the message.Read-Only:
uid
(String) The UID of the contact point.oncall
Required:
url
(String) The URL to send webhook requests to.Optional:
authorization_credentials
(String, Sensitive) Allows a custom authorization scheme - attaches an auth header with this value. Do not use in conjunction with basic auth parameters.authorization_scheme
(String) Allows a custom authorization scheme - attaches an auth header with this name. Do not use in conjunction with basic auth parameters.basic_auth_password
(String, Sensitive) The username to use in basic auth headers attached to the request. If omitted, basic auth will not be used.basic_auth_user
(String) The username to use in basic auth headers attached to the request. If omitted, basic auth will not be used.disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.http_method
(String) The HTTP method to use in the request. Defaults to POST
.max_alerts
(Number) The maximum number of alerts to send in a single request. This can be helpful in limiting the size of the request body. The default is 0, which indicates no limit.message
(String) Custom message. You can use template variables.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.title
(String) Templated title of the message.Read-Only:
uid
(String) The UID of the contact point.opsgenie
Required:
api_key
(String, Sensitive) The OpsGenie API key to use.Optional:
auto_close
(Boolean) Whether to auto-close alerts in OpsGenie when they resolve in the Alertmanager.description
(String) A templated high-level description to use for the alert.disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.message
(String) The templated content of the message.override_priority
(Boolean) Whether to allow the alert priority to be configured via the value of the og_priority
annotation on the alert.responders
(Block List) Teams, users, escalations and schedules that the alert will be routed to send notifications. If the API Key belongs to a team integration, this field will be overwritten with the owner team. This feature is available from Grafana 10.3+. (see below for nested schema)send_tags_as
(String) Whether to send annotations to OpsGenie as Tags, Details, or both. Supported values are tags
, details
, both
, or empty to use the default behavior of Tags.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.url
(String) Allows customization of the OpsGenie API URL.Read-Only:
uid
(String) The UID of the contact point.opsgenie.responders
Required:
type
(String) Type of the responder. Supported: team, teams, user, escalation, schedule or a template that is expanded to one of these values.Optional:
id
(String) ID of the responder. Must be specified if name and username are empty.name
(String) Name of the responder. Must be specified if username and id are empty.username
(String) User name of the responder. Must be specified if name and id are empty.pagerduty
Required:
integration_key
(String, Sensitive) The PagerDuty API key.Optional:
class
(String) The class or type of event, for example ping failure
.client
(String) The name of the monitoring client that is triggering this event.client_url
(String) The URL of the monitoring client that is triggering this event.component
(String) The component being affected by the event.details
(Map of String) A set of arbitrary key/value pairs that provide further detail about the incident.disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.group
(String) The group to which the provided component belongs to.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.severity
(String) The PagerDuty event severity level. Default is critical
.source
(String) The unique location of the affected system.summary
(String) The templated summary message of the event.Read-Only:
uid
(String) The UID of the contact point.pushover
Required:
api_token
(String, Sensitive) The Pushover API token.user_key
(String, Sensitive) The Pushover user key.Optional:
device
(String) Comma-separated list of devices to which the event is associated.disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.expire
(Number) How many seconds for which the notification will continue to be retried by Pushover.message
(String) The templated notification message content.ok_priority
(Number) The priority level of the resolved event.ok_sound
(String) The sound associated with the resolved notification.priority
(Number) The priority level of the event.retry
(Number) How often, in seconds, the Pushover servers will send the same notification to the user.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.sound
(String) The sound associated with the notification.title
(String) The templated title of the message.upload_image
(Boolean) Whether to send images in the notification or not. Default is true. Requires Grafana to be configured to send images in notifications.Read-Only:
uid
(String) The UID of the contact point.sensugo
Required:
api_key
(String, Sensitive) The SensuGo API key.url
(String) The SensuGo URL to send requests to.Optional:
check
(String) The SensuGo check to which the event should be routed.disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.entity
(String) The entity being monitored.handler
(String) A custom handler to execute in addition to the check.message
(String) Templated message content describing the alert.namespace
(String) The namespace in which the check resides.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.Read-Only:
uid
(String) The UID of the contact point.slack
Optional:
disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.endpoint_url
(String) Use this to override the Slack API endpoint URL to send requests to.icon_emoji
(String) The name of a Slack workspace emoji to use as the bot icon.icon_url
(String) A URL of an image to use as the bot icon.mention_channel
(String) Describes how to ping the slack channel that messages are being sent to. Options are here
for an @here ping, channel
for @channel, or empty for no ping.mention_groups
(String) Comma-separated list of groups to mention in the message.mention_users
(String) Comma-separated list of users to mention in the message.recipient
(String) Channel, private group, or IM channel (can be an encoded ID or a name) to send messages to.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.text
(String) Templated content of the message.title
(String) Templated title of the message.token
(String, Sensitive) A Slack API token,for sending messages directly without the webhook method.url
(String, Sensitive) A Slack webhook URL,for sending messages via the webhook method.username
(String) Username for the bot to use.Read-Only:
uid
(String) The UID of the contact point.sns
Required:
topic
(String) The Amazon SNS topic to send notifications to.Optional:
access_key
(String, Sensitive) AWS access key ID used to authenticate with Amazon SNS.assume_role_arn
(String) The Amazon Resource Name (ARN) of the role to assume to send notifications to Amazon SNS.auth_provider
(String) The authentication provider to use. Valid values are default
, arn
and keys
. Default is default
. Defaults to default
.body
(String)disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.external_id
(String) The external ID to use when assuming the role.message_format
(String) The format of the message to send. Valid values are text
, body
and json
. Default is text
. Defaults to text
.secret_key
(String, Sensitive) AWS secret access key used to authenticate with Amazon SNS.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.subject
(String)Read-Only:
uid
(String) The UID of the contact point.teams
Required:
url
(String, Sensitive) A Teams webhook URL.Optional:
disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.message
(String) The templated message content to send.section_title
(String) The templated subtitle for each message section.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.title
(String) The templated title of the message.Read-Only:
uid
(String) The UID of the contact point.telegram
Required:
chat_id
(String) The chat ID to send messages to.token
(String, Sensitive) The Telegram bot token.Optional:
disable_notifications
(Boolean) When set users will receive a notification with no sound.disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.disable_web_page_preview
(Boolean) When set it disables link previews for links in the message.message
(String) The templated content of the message.parse_mode
(String) Mode for parsing entities in the message text. Supported: None, Markdown, MarkdownV2, and HTML. HTML is the default.protect_content
(Boolean) When set it protects the contents of the message from forwarding and saving.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.Read-Only:
uid
(String) The UID of the contact point.threema
Required:
api_secret
(String, Sensitive) The Threema API key.gateway_id
(String) The Threema gateway ID.recipient_id
(String) The ID of the recipient of the message.Optional:
description
(String) The templated description of the message.disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.title
(String) The templated title of the message.Read-Only:
uid
(String) The UID of the contact point.victorops
Required:
url
(String) The VictorOps webhook URL.Optional:
description
(String) Templated description of the message.disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.message_type
(String) The VictorOps alert state - typically either CRITICAL
or RECOVERY
.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.title
(String) Templated title to display.Read-Only:
uid
(String) The UID of the contact point.webex
Optional:
api_url
(String) The URL to send webhook requests to.disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.message
(String) The templated title of the message to send.room_id
(String) ID of the Webex Teams room where to send the messages.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.token
(String, Sensitive) The bearer token used to authorize the client.Read-Only:
uid
(String) The UID of the contact point.webhook
Required:
url
(String) The URL to send webhook requests to.Optional:
authorization_credentials
(String, Sensitive) Allows a custom authorization scheme - attaches an auth header with this value. Do not use in conjunction with basic auth parameters.authorization_scheme
(String) Allows a custom authorization scheme - attaches an auth header with this name. Do not use in conjunction with basic auth parameters.basic_auth_password
(String, Sensitive) The username to use in basic auth headers attached to the request. If omitted, basic auth will not be used.basic_auth_user
(String) The username to use in basic auth headers attached to the request. If omitted, basic auth will not be used.disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.http_method
(String) The HTTP method to use in the request. Defaults to POST
.max_alerts
(Number) The maximum number of alerts to send in a single request. This can be helpful in limiting the size of the request body. The default is 0, which indicates no limit.message
(String) Custom message. You can use template variables.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.title
(String) Templated title of the message.Read-Only:
uid
(String) The UID of the contact point.wecom
Optional:
agent_id
(String) Agent ID added to the request payload when using APIAPP.corp_id
(String) Corp ID used to get token when using APIAPP.disable_resolve_message
(Boolean) Whether to disable sending resolve messages. Defaults to false
.message
(String) The templated content of the message to send.msg_type
(String) The type of them message. Supported: markdown, text. Default: text.secret
(String, Sensitive) The secret key required to obtain access token when using APIAPP. See https://work.weixin.qq.com/wework_admin/frame#apps to create APIAPP.settings
(Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to map[]
.title
(String) The templated title of the message to send.to_user
(String) The ID of user that should receive the message. Multiple entries should be separated by '|'. Default: @all.url
(String, Sensitive) The WeCom webhook URL. Required if using GroupRobot.Read-Only:
uid
(String) The UID of the contact point.Import is supported using the following syntax:
terraform import grafana_contact_point.name "{{ name }}"
terraform import grafana_contact_point.name "{{ orgID }}:{{ name }}"