<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Provision Grafana Alerting resources on Grafana Labs</title><link>https://grafana.com/docs/grafana/v9.5/alerting/set-up/provision-alerting-resources/</link><description>Recent content in Provision Grafana Alerting resources on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v9.5/alerting/set-up/provision-alerting-resources/index.xml" rel="self" type="application/rss+xml"/><item><title>Create and manage alerting resources using file provisioning</title><link>https://grafana.com/docs/grafana/v9.5/alerting/set-up/provision-alerting-resources/file-provisioning/</link><pubDate>Mon, 16 Mar 2026 00:39:39 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.5/alerting/set-up/provision-alerting-resources/file-provisioning/</guid><content><![CDATA[&lt;h2 id=&#34;create-and-manage-alerting-resources-using-file-provisioning&#34;&gt;Create and manage alerting resources using file provisioning&lt;/h2&gt;
&lt;p&gt;Provision your alerting resources using files from disk. When you start Grafana, the data from these files is created in your Grafana system. Grafana adds any new resources you created, updates any that you changed, and deletes old ones.&lt;/p&gt;
&lt;p&gt;Arrange your files in a directory in a way that best suits your use case. For example, you can choose a team-based layout where every team has its own file, you can have one big file for all your teams; or you can have one file per resource type.&lt;/p&gt;
&lt;p&gt;Details on how to set up the files and which fields are required for each object are listed below depending on which resource you are provisioning.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Provisioning takes place during the initial set up of your Grafana system, but you can re-run it at any time using the &lt;a href=&#34;/docs/grafana/latest/developers/http_api/admin/#reload-provisioning-configurations&#34;&gt;Grafana Admin API&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;provision-alert-rules&#34;&gt;Provision alert rules&lt;/h3&gt;
&lt;p&gt;Create or delete alert rules in your Grafana instance(s).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create alert rules in Grafana.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use the &lt;a href=&#34;/docs/grafana/latest/developers/http_api/alerting_provisioning/#route-get-alert-rule-export&#34;&gt;Alerting provisioning API&lt;/a&gt; export endpoints to download a provisioning file for your alert rules.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy the contents into a YAML or JSON configuration file in the default provisioning directory or in your configured directory.&lt;/p&gt;
&lt;p&gt;Example configuration files can be found below.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ensure that your files are in the right directory on the node running the Grafana server, so that they deploy alongside your Grafana instance(s).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Delete the alert rules in Grafana that will be provisioned.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you do not delete the alert rule, it will clash with the provisioned alert rule once uploaded.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here is an example of a configuration file for creating alert rules.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# config file version
apiVersion: 1

# List of rule groups to import or update
groups:
  # &amp;lt;int&amp;gt; organization ID, default = 1
  - orgId: 1
    # &amp;lt;string, required&amp;gt; name of the rule group
    name: my_rule_group
    # &amp;lt;string, required&amp;gt; name of the folder the rule group will be stored in
    folder: my_first_folder
    # &amp;lt;duration, required&amp;gt; interval that the rule group should evaluated at
    interval: 60s
    # &amp;lt;list, required&amp;gt; list of rules that are part of the rule group
    rules:
      # &amp;lt;string, required&amp;gt; unique identifier for the rule
      - uid: my_id_1
        # &amp;lt;string, required&amp;gt; title of the rule that will be displayed in the UI
        title: my_first_rule
        # &amp;lt;string, required&amp;gt; which query should be used for the condition
        condition: A
        # &amp;lt;list, required&amp;gt; list of query objects that should be executed on each
        #                  evaluation - should be obtained through the API
        data:
          - refId: A
            datasourceUid: &amp;#39;__expr__&amp;#39;
            model:
              conditions:
                - evaluator:
                    params:
                      - 3
                    type: gt
                  operator:
                    type: and
                  query:
                    params:
                      - A
                  reducer:
                    type: last
                  type: query
              datasource:
                type: __expr__
                uid: &amp;#39;__expr__&amp;#39;
              expression: 1==0
              intervalMs: 1000
              maxDataPoints: 43200
              refId: A
              type: math
        # &amp;lt;string&amp;gt; UID of a dashboard that the alert rule should be linked to
        dashboardUid: my_dashboard
        # &amp;lt;int&amp;gt; ID of the panel that the alert rule should be linked to
        panelId: 123
        # &amp;lt;string&amp;gt; the state the alert rule will have when no data is returned
        #          possible values: &amp;#34;NoData&amp;#34;, &amp;#34;Alerting&amp;#34;, &amp;#34;OK&amp;#34;, default = NoData
        noDataState: Alerting
        # &amp;lt;string&amp;gt; the state the alert rule will have when the query execution
        #          failed - possible values: &amp;#34;Error&amp;#34;, &amp;#34;Alerting&amp;#34;, &amp;#34;OK&amp;#34;
        #          default = Alerting
        # &amp;lt;duration, required&amp;gt; for how long should the alert fire before alerting
        for: 60s
        # &amp;lt;map&amp;lt;string, string&amp;gt;&amp;gt; a map of strings to pass around any data
        annotations:
          some_key: some_value
        # &amp;lt;map&amp;lt;string, string&amp;gt; a map of strings that can be used to filter and
        #                      route alerts
        labels:
          team: sre_team_1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Here is an example of a configuration file for deleting alert rules.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# config file version
apiVersion: 1

# List of alert rule UIDs that should be deleted
deleteRules:
  # &amp;lt;int&amp;gt; organization ID, default = 1
  - orgId: 1
    # &amp;lt;string, required&amp;gt; unique identifier for the rule
    uid: my_id_1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;provision-contact-points&#34;&gt;Provision contact points&lt;/h3&gt;
&lt;p&gt;Create or delete contact points in your Grafana instance(s).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a YAML or JSON configuration file.&lt;/p&gt;
&lt;p&gt;Example configuration files can be found below.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the file(s) to your GitOps workflow, so that they deploy alongside your Grafana instance(s).&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here is an example of a configuration file for creating contact points.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# config file version
apiVersion: 1

# List of contact points to import or update
contactPoints:
  # &amp;lt;int&amp;gt; organization ID, default = 1
  - orgId: 1
    # &amp;lt;string, required&amp;gt; name of the contact point
    name: cp_1
    receivers:
      # &amp;lt;string, required&amp;gt; unique identifier for the receiver
      - uid: first_uid
        # &amp;lt;string, required&amp;gt; type of the receiver
        type: prometheus-alertmanager
        # &amp;lt;object, required&amp;gt; settings for the specific receiver type
        settings:
          url: http://test:9000&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Here is an example of a configuration file for deleting contact points.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# config file version
apiVersion: 1

# List of receivers that should be deleted
deleteContactPoints:
  # &amp;lt;int&amp;gt; organization ID, default = 1
  - orgId: 1
    # &amp;lt;string, required&amp;gt; unique identifier for the receiver
    uid: first_uid&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;settings&#34;&gt;Settings&lt;/h4&gt;
&lt;p&gt;Here are some examples of settings you can use for the different
contact point integrations.&lt;/p&gt;
&lt;h5 id=&#34;alertmanager&#34;&gt;Alertmanager&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: prometheus-alertmanager
settings:
  # &amp;lt;string, required&amp;gt;
  url: http://localhost:9093
  # &amp;lt;string&amp;gt;
  basicAuthUser: abc
  # &amp;lt;string&amp;gt;
  basicAuthPassword: abc123&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;dingding&#34;&gt;DingDing&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: dingding
settings:
  # &amp;lt;string, required&amp;gt;
  url: https://oapi.dingtalk.com/robot/send?access_token=xxxxxxxxx
  # &amp;lt;string&amp;gt; options: link, actionCard
  msgType: link
  # &amp;lt;string&amp;gt;
  message: |
    {{ template &amp;#34;default.message&amp;#34; . }}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;discord&#34;&gt;Discord&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: discord
settings:
  # &amp;lt;string, required&amp;gt;
  url: https://discord/webhook
  # &amp;lt;string&amp;gt;
  avatar_url: https://my_avatar
  # &amp;lt;string&amp;gt;
  use_discord_username: Grafana
  # &amp;lt;string&amp;gt;
  message: |
    {{ template &amp;#34;default.message&amp;#34; . }}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;e-mail&#34;&gt;E-Mail&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: email
settings:
  # &amp;lt;string, required&amp;gt;
  addresses: me@example.com;you@example.com
  # &amp;lt;bool&amp;gt;
  singleEmail: false
  # &amp;lt;string&amp;gt;
  message: my optional message to include
  # &amp;lt;string&amp;gt;
  subject: |
    {{ template &amp;#34;default.title&amp;#34; . }}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;google-hangouts-chat&#34;&gt;Google Hangouts Chat&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: googlechat
settings:
  # &amp;lt;string, required&amp;gt;
  url: https://google/webhook
  # &amp;lt;string&amp;gt;
  message: |
    {{ template &amp;#34;default.message&amp;#34; . }}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;kafka&#34;&gt;Kafka&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: kafka
settings:
  # &amp;lt;string, required&amp;gt;
  kafkaRestProxy: http://localhost:8082
  # &amp;lt;string, required&amp;gt;
  kafkaTopic: topic1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;line&#34;&gt;LINE&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: line
settings:
  # &amp;lt;string, required&amp;gt;
  token: xxx&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;microsoft-teams&#34;&gt;Microsoft Teams&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: teams
settings:
  # &amp;lt;string, required&amp;gt;
  url: https://ms_teams_url
  # &amp;lt;string&amp;gt;
  title: |
    {{ template &amp;#34;default.title&amp;#34; . }}
  # &amp;lt;string&amp;gt;
  sectiontitle: &amp;#39;&amp;#39;
  # &amp;lt;string&amp;gt;
  message: |
    {{ template &amp;#34;default.message&amp;#34; . }}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;opsgenie&#34;&gt;OpsGenie&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: opsgenie
settings:
  # &amp;lt;string, required&amp;gt;
  apiKey: xxx
  # &amp;lt;string, required&amp;gt;
  apiUrl: https://api.opsgenie.com/v2/alerts
  # &amp;lt;string&amp;gt;
  message: |
    {{ template &amp;#34;default.title&amp;#34; . }}
  # &amp;lt;string&amp;gt;
  description: some descriptive description
  # &amp;lt;bool&amp;gt;
  autoClose: false
  # &amp;lt;bool&amp;gt;
  overridePriority: false
  # &amp;lt;string&amp;gt; options: tags, details, both
  sendTagsAs: both&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;pagerduty&#34;&gt;PagerDuty&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: pagerduty
settings:
  # &amp;lt;string, required&amp;gt; the 32-character Events API key https://support.pagerduty.com/docs/api-access-keys#events-api-keys
  integrationKey: XXX
  # &amp;lt;string&amp;gt; options: critical, error, warning, info
  severity: critical
  # &amp;lt;string&amp;gt;
  class: ping failure
  # &amp;lt;string&amp;gt;
  component: Grafana
  # &amp;lt;string&amp;gt;
  group: app-stack
  # &amp;lt;string&amp;gt;
  summary: |
    {{ template &amp;#34;default.message&amp;#34; . }}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;pushover&#34;&gt;Pushover&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: pushover
settings:
  # &amp;lt;string, required&amp;gt;
  apiToken: XXX
  # &amp;lt;string, required&amp;gt;
  userKey: user1,user2
  # &amp;lt;string&amp;gt;
  device: device1,device2
  # &amp;lt;string&amp;gt; options (high to low): 2,1,0,-1,-2
  priority: &amp;#39;2&amp;#39;
  # &amp;lt;string&amp;gt;
  retry: &amp;#39;30&amp;#39;
  # &amp;lt;string&amp;gt;
  expire: &amp;#39;120&amp;#39;
  # &amp;lt;string&amp;gt;
  sound: siren
  # &amp;lt;string&amp;gt;
  okSound: magic
  # &amp;lt;string&amp;gt;
  message: |
    {{ template &amp;#34;default.message&amp;#34; . }}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;slack&#34;&gt;Slack&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: slack
settings:
  # &amp;lt;string, required&amp;gt;
  recipient: alerting-dev
  # &amp;lt;string, required&amp;gt;
  token: xxx
  # &amp;lt;string&amp;gt;
  username: grafana_bot
  # &amp;lt;string&amp;gt;
  icon_emoji: heart
  # &amp;lt;string&amp;gt;
  icon_url: https://icon_url
  # &amp;lt;string&amp;gt;
  mentionUsers: user_1,user_2
  # &amp;lt;string&amp;gt;
  mentionGroups: group_1,group_2
  # &amp;lt;string&amp;gt; options: here, channel
  mentionChannel: here
  # &amp;lt;string&amp;gt; Optionally provide a Slack incoming webhook URL for sending messages, in this case the token isn&amp;#39;t necessary
  url: https://some_webhook_url
  # &amp;lt;string&amp;gt;
  endpointUrl: https://custom_url/api/chat.postMessage
  # &amp;lt;string&amp;gt;
  title: |
    {{ template &amp;#34;slack.default.title&amp;#34; . }}
  text: |
    {{ template &amp;#34;slack.default.text&amp;#34; . }}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;sensu-go&#34;&gt;Sensu Go&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: sensugo
settings:
  # &amp;lt;string, required&amp;gt;
  url: http://sensu-api.local:8080
  # &amp;lt;string, required&amp;gt;
  apikey: xxx
  # &amp;lt;string&amp;gt;
  entity: default
  # &amp;lt;string&amp;gt;
  check: default
  # &amp;lt;string&amp;gt;
  handler: some_handler
  # &amp;lt;string&amp;gt;
  namespace: default
  # &amp;lt;string&amp;gt;
  message: |
    {{ template &amp;#34;default.message&amp;#34; . }}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;telegram&#34;&gt;Telegram&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: telegram
settings:
  # &amp;lt;string, required&amp;gt;
  bottoken: xxx
  # &amp;lt;string, required&amp;gt;
  chatid: some_chat_id
  # &amp;lt;string&amp;gt;
  message: |
    {{ template &amp;#34;default.message&amp;#34; . }}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;threema-gateway&#34;&gt;Threema Gateway&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: threema
settings:
  # &amp;lt;string, required&amp;gt;
  api_secret: xxx
  # &amp;lt;string, required&amp;gt;
  gateway_id: A5K94S9
  # &amp;lt;string, required&amp;gt;
  recipient_id: A9R4KL4S&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;victorops&#34;&gt;VictorOps&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: victorops
settings:
  # &amp;lt;string, required&amp;gt;
  url: XXX
  # &amp;lt;string&amp;gt; options: CRITICAL, WARNING
  messageType: CRITICAL&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;webhook&#34;&gt;Webhook&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: webhook
settings:
  # &amp;lt;string, required&amp;gt;
  url: https://endpoint_url
  # &amp;lt;string&amp;gt; options: POST, PUT
  httpMethod: POST
  # &amp;lt;string&amp;gt;
  username: abc
  # &amp;lt;string&amp;gt;
  password: abc123
  # &amp;lt;string&amp;gt;
  authorization_scheme: Bearer
  # &amp;lt;string&amp;gt;
  authorization_credentials: abc123
  # &amp;lt;string&amp;gt;
  maxAlerts: &amp;#39;10&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;wecom&#34;&gt;WeCom&lt;/h5&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;type: wecom
settings:
  # &amp;lt;string, required&amp;gt;
  url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxxxx
  # &amp;lt;string&amp;gt;
  message: |
    {{ template &amp;#34;default.message&amp;#34; . }}
  # &amp;lt;string&amp;gt;
  title: |
    {{ template &amp;#34;default.title&amp;#34; . }}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;provision-notification-policies&#34;&gt;Provision notification policies&lt;/h3&gt;
&lt;p&gt;Create or reset notification policies in your Grafana instance(s).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a YAML or JSON configuration file.&lt;/p&gt;
&lt;p&gt;Example configuration files can be found below.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the file(s) to your GitOps workflow, so that they deploy alongside your Grafana instance(s).&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here is an example of a configuration file for creating notification policiies.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# config file version
apiVersion: 1

# List of notification policies
policies:
  # &amp;lt;int&amp;gt; organization ID, default = 1
  - orgId: 1
    # &amp;lt;string&amp;gt; name of the contact point that should be used for this route
    receiver: grafana-default-email
    # &amp;lt;list&amp;gt; The labels by which incoming alerts are grouped together. For example,
    #        multiple alerts coming in for cluster=A and alertname=LatencyHigh would
    #        be batched into a single group.
    #
    #        To aggregate by all possible labels use the special value &amp;#39;...&amp;#39; as
    #        the sole label name, for example:
    #        group_by: [&amp;#39;...&amp;#39;]
    #        This effectively disables aggregation entirely, passing through all
    #        alerts as-is. This is unlikely to be what you want, unless you have
    #        a very low alert volume or your upstream notification system performs
    #        its own grouping.
    group_by: [&amp;#39;...&amp;#39;]
    # &amp;lt;list&amp;gt; a list of prometheus-like matchers that an alert rule has to fulfill to match the node (allowed chars
    #        [a-zA-Z_:])
    matchers:
      - alertname = Watchdog
      - service_id_X = serviceX
      - severity =~ &amp;#34;warning|critical&amp;#34;
    # &amp;lt;list&amp;gt; a list of grafana-like matchers that an alert rule has to fulfill to match the node
    object_matchers:
      - [&amp;#39;alertname&amp;#39;, &amp;#39;=&amp;#39;, &amp;#39;CPUUsage&amp;#39;]
      - [&amp;#39;service_id-X&amp;#39;, &amp;#39;=&amp;#39;, &amp;#39;serviceX&amp;#39;]
      - [&amp;#39;severity&amp;#39;, &amp;#39;=~&amp;#39;, &amp;#39;warning|critical&amp;#39;]
    # &amp;lt;list&amp;gt; Times when the route should be muted. These must match the name of a
    #        mute time interval.
    #        Additionally, the root node cannot have any mute times.
    #        When a route is muted it will not send any notifications, but
    #        otherwise acts normally (including ending the route-matching process
    #        if the `continue` option is not set)
    mute_time_intervals:
      - abc
    # &amp;lt;duration&amp;gt; How long to initially wait to send a notification for a group
    #            of alerts. Allows to collect more initial alerts for the same group.
    #            (Usually ~0s to few minutes), default = 30s
    group_wait: 30s
    # &amp;lt;duration&amp;gt; How long to wait before sending a notification about new alerts that
    #            are added to a group of alerts for which an initial notification has
    #            already been sent. (Usually ~5m or more), default = 5m
    group_interval: 5m
    # &amp;lt;duration&amp;gt;  How long to wait before sending a notification again if it has already
    #             been sent successfully for an alert. (Usually ~3h or more), default = 4h
    repeat_interval: 4h
    # &amp;lt;list&amp;gt; Zero or more child routes
    # routes:
    # ...&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Here is an example of a configuration file for resetting notification policies.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# config file version
apiVersion: 1

# List of orgIds that should be reset to the default policy
resetPolicies:
  - 1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;provision-templates&#34;&gt;Provision templates&lt;/h3&gt;
&lt;p&gt;Create or delete templates in your Grafana instance(s).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a YAML or JSON configuration file.&lt;/p&gt;
&lt;p&gt;Example configuration files can be found below.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the file(s) to your GitOps workflow, so that they deploy alongside your Grafana instance(s).&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here is an example of a configuration file for creating templates.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# config file version
apiVersion: 1

# List of templates to import or update
templates:
  # &amp;lt;int&amp;gt; organization ID, default = 1
  - orgID: 1
    # &amp;lt;string, required&amp;gt; name of the template, must be unique
    name: my_first_template
    # &amp;lt;string, required&amp;gt; content of the the template
    template: Alerting with a custom text template&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Here is an example of a configuration file for deleting templates.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# config file version
apiVersion: 1

# List of alert rule UIDs that should be deleted
deleteTemplates:
  # &amp;lt;int&amp;gt; organization ID, default = 1
  - orgId: 1
    # &amp;lt;string, required&amp;gt; name of the template, must be unique
    name: my_first_template&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;provision-mute-timings&#34;&gt;Provision mute timings&lt;/h3&gt;
&lt;p&gt;Create or delete mute timings in your Grafana instance(s).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a YAML or JSON configuration file.&lt;/p&gt;
&lt;p&gt;Example configuration files can be found below.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the file(s) to your GitOps workflow, so that they deploy alongside your Grafana instance(s).&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here is an example of a configuration file for creating mute timings.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# config file version
apiVersion: 1

# List of mute time intervals to import or update
muteTimes:
  # &amp;lt;int&amp;gt; organization ID, default = 1
  - orgId: 1
    # &amp;lt;string, required&amp;gt; name of the mute time interval, must be unique
    name: mti_1
    # &amp;lt;list&amp;gt; time intervals that should trigger the muting
    #        refer to https://prometheus.io/docs/alerting/latest/configuration/#time_interval-0
    time_intervals:
      - times:
          - start_time: &amp;#39;06:00&amp;#39;
            end_time: &amp;#39;23:59&amp;#39;
        weekdays: [&amp;#39;monday:wednesday&amp;#39;, &amp;#39;saturday&amp;#39;, &amp;#39;sunday&amp;#39;]
        months: [&amp;#39;1:3&amp;#39;, &amp;#39;may:august&amp;#39;, &amp;#39;december&amp;#39;]
        years: [&amp;#39;2020:2022&amp;#39;, &amp;#39;2030&amp;#39;]
        days_of_month: [&amp;#39;1:5&amp;#39;, &amp;#39;-3:-1&amp;#39;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Here is an example of a configuration file for deleting mute timings.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# config file version
apiVersion: 1

# List of mute time intervals that should be deleted
deleteMuteTimes:
  # &amp;lt;int&amp;gt; organization ID, default = 1
  - orgId: 1
    # &amp;lt;string, required&amp;gt; name of the mute time interval, must be unique
    name: mti_1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;file-provisioning-using-kubernetes&#34;&gt;File provisioning using Kubernetes&lt;/h3&gt;
&lt;p&gt;If you are a Kubernetes user, you can leverage file provisioning using Kubernetes configuration maps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create one or more configuration maps as follows.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;apiVersion: v1
kind: ConfigMap
metadata:
  name: grafana-alerting
data:
  provisioning.yaml: |
    templates:
    - name: my_first_template
      template: the content for my template&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;Add the file(s) to your GitOps workflow, so that they deploy alongside your Grafana instance(s).&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana
spec:
  replicas: 1
  selector:
    matchLabels:
      app: grafana
  template:
    metadata:
      name: grafana
      labels:
        app: grafana
    spec:
      containers:
        - name: grafana
          image: grafana/grafana:latest
          ports:
            - name: grafana
              containerPort: 3000
          volumeMounts:
            - mountPath: /etc/grafana/provisioning/alerting
              name: grafana-alerting
              readOnly: false
      volumes:
        - name: grafana-alerting
          configMap:
            defaultMode: 420
            name: grafana-alerting&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This eliminates the need for a persistent database to use Grafana Alerting in Kubernetes; all your provisioned resources appear after each restart or re-deployment.&lt;/p&gt;
]]></content><description>&lt;h2 id="create-and-manage-alerting-resources-using-file-provisioning">Create and manage alerting resources using file provisioning&lt;/h2>
&lt;p>Provision your alerting resources using files from disk. When you start Grafana, the data from these files is created in your Grafana system. Grafana adds any new resources you created, updates any that you changed, and deletes old ones.&lt;/p></description></item><item><title>Create and manage alerting resources using Terraform</title><link>https://grafana.com/docs/grafana/v9.5/alerting/set-up/provision-alerting-resources/terraform-provisioning/</link><pubDate>Mon, 16 Mar 2026 00:39:39 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.5/alerting/set-up/provision-alerting-resources/terraform-provisioning/</guid><content><![CDATA[&lt;h1 id=&#34;create-and-manage-alerting-resources-using-terraform&#34;&gt;Create and manage alerting resources using Terraform&lt;/h1&gt;
&lt;p&gt;Use Terraform’s Grafana Provider to manage your alerting resources and provision them into your Grafana system. Terraform provider support for Grafana Alerting makes it easy to create, manage, and maintain your entire Grafana Alerting stack as code.&lt;/p&gt;
&lt;p&gt;For more information on managing your alerting resources using Terraform, refer to the &lt;a href=&#34;https://registry.terraform.io/providers/grafana/grafana/latest/docs&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Provider&lt;/a&gt; documentation.&lt;/p&gt;
&lt;p&gt;Complete the following tasks to create and manage your alerting resources using Terraform.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create an API key for provisioning.&lt;/li&gt;
&lt;li&gt;Configure the Terraform provider.&lt;/li&gt;
&lt;li&gt;Define your alerting resources in Terraform.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;terraform apply&lt;/code&gt; to provision your alerting resources.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Ensure you have the grafana/grafana &lt;a href=&#34;https://registry.terraform.io/providers/grafana/grafana/1.28.0&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Terraform provider&lt;/a&gt; 1.27.0 or higher.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ensure you are using Grafana 9.1 or higher.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;create-an-api-key-for-provisioning&#34;&gt;Create an API key for provisioning&lt;/h2&gt;
&lt;p&gt;You can &lt;a href=&#34;/docs/grafana/latest/administration/api-keys/&#34;&gt;create a normal Grafana API key&lt;/a&gt; to authenticate Terraform with Grafana. Most existing tooling using API keys should automatically work with the new Grafana Alerting support.&lt;/p&gt;
&lt;p&gt;There are also dedicated RBAC roles for alerting provisioning. This lets you easily authenticate as a &lt;a href=&#34;/docs/grafana/latest/administration/service-accounts/&#34;&gt;service account&lt;/a&gt; with the minimum permissions needed to provision your Alerting infrastructure.&lt;/p&gt;
&lt;p&gt;To create an API key for provisioning, complete the following steps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new service account for your CI pipeline.&lt;/li&gt;
&lt;li&gt;Assign the role “Access the alert rules Provisioning API.”&lt;/li&gt;
&lt;li&gt;Create a new service account token.&lt;/li&gt;
&lt;li&gt;Name and save the token for use in Terraform.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Alternatively, you can use basic authentication. To view all the supported authentication formats, see &lt;a href=&#34;https://registry.terraform.io/providers/grafana/grafana/latest/docs#authentication&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;configure-the-terraform-provider&#34;&gt;Configure the Terraform provider&lt;/h2&gt;
&lt;p&gt;Grafana Alerting support is included as part of the &lt;a href=&#34;https://registry.terraform.io/providers/grafana/grafana/latest/docs&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Terraform provider&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The following is an example you can use to configure the Terraform provider.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;terraform&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-terraform&#34;&gt;terraform {
    required_providers {
        grafana = {
            source = &amp;#34;grafana/grafana&amp;#34;
            version = &amp;#34;&amp;gt;= 1.28.2&amp;#34;
        }
    }
}

provider &amp;#34;grafana&amp;#34; {
    url = &amp;lt;YOUR_GRAFANA_URL&amp;gt;
    auth = &amp;lt;YOUR_GRAFANA_API_KEY&amp;gt;
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;provision-contact-points-and-templates&#34;&gt;Provision contact points and templates&lt;/h2&gt;
&lt;p&gt;Contact points connect an alerting stack to the outside world. They tell Grafana how to connect to your external systems and where to deliver notifications. There are over fifteen different &lt;a href=&#34;https://registry.terraform.io/providers/grafana/grafana/latest/docs/resources/contact_point#optional&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;integrations&lt;/a&gt; to choose from.&lt;/p&gt;
&lt;p&gt;To provision contact points and templates, complete the following steps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Copy this code block into a .tf file on your local machine.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This example creates a contact point that sends alert notifications to Slack.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;terraform&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-terraform&#34;&gt;resource &amp;#34;grafana_contact_point&amp;#34; &amp;#34;my_slack_contact_point&amp;#34; {
    name = &amp;#34;Send to My Slack Channel&amp;#34;

    slack {
        url = &amp;lt;YOUR_SLACK_WEBHOOK_URL&amp;gt;
        text = &amp;lt;&amp;lt;EOT
{{ len .Alerts.Firing }} alerts are firing!

Alert summaries:
{{ range .Alerts.Firing }}
{{ template &amp;#34;Alert Instance Template&amp;#34; . }}
{{ end }}
EOT
    }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;Enter text for your notification in the text field.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The &lt;code&gt;text&lt;/code&gt; field supports &lt;a href=&#34;https://pkg.go.dev/text/template&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Go-style templating&lt;/a&gt;. This enables you to manage your Grafana Alerting notification templates directly in Terraform.&lt;/p&gt;
&lt;ol start=&#34;3&#34;&gt;
&lt;li&gt;
&lt;p&gt;Run the command ‘terraform apply’.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Go to the Grafana UI and check the details of your contact point.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You cannot edit resources provisioned via Terraform from the UI. This ensures that your alerting stack always stays in sync with your code.&lt;/p&gt;
&lt;ol start=&#34;5&#34;&gt;
&lt;li&gt;Click &lt;strong&gt;Test&lt;/strong&gt; to verify that the contact point works correctly.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can reuse the same templates across many contact points. In the example above, a shared template ie embedded using the statement &lt;code&gt;{{ template “Alert Instance Template” . }}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This fragment can then be managed separately in Terraform:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;terraform&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-terraform&#34;&gt;resource &amp;#34;grafana_message_template&amp;#34; &amp;#34;my_alert_template&amp;#34; {
    name = &amp;#34;Alert Instance Template&amp;#34;

    template = &amp;lt;&amp;lt;EOT
{{ define &amp;#34;Alert Instance Template&amp;#34; }}
Firing: {{ .Labels.alertname }}
Silence: {{ .SilenceURL }}
{{ end }}
EOT
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;provision-notification-policies-and-routing&#34;&gt;Provision notification policies and routing&lt;/h2&gt;
&lt;p&gt;Notification policies tell Grafana how to route alert instances, as opposed to where. They connect firing alerts to your previously defined contact points using a system of labels and matchers.&lt;/p&gt;
&lt;p&gt;To provision notification policies and routing, complete the following steps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Copy this code block into a .tf file on your local machine.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In this example, the alerts are grouped by &lt;code&gt;alertname&lt;/code&gt;, which means that any notifications coming from alerts which share the same name, are grouped into the same Slack message.&lt;/p&gt;
&lt;p&gt;If you want to route specific notifications differently, you can add sub-policies. Sub-policies allow you to apply routing to different alerts based on label matching. In this example, we apply a mute timing to all alerts with the label a=b.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;terraform&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-terraform&#34;&gt;resource &amp;#34;grafana_notification_policy&amp;#34; &amp;#34;my_policy&amp;#34; {
    group_by = [&amp;#34;alertname&amp;#34;]
    contact_point = grafana_contact_point.my_slack_contact_point.name

    group_wait = &amp;#34;45s&amp;#34;
    group_interval = &amp;#34;6m&amp;#34;
    repeat_interval = &amp;#34;3h&amp;#34;

    policy {
        matcher {
            label = &amp;#34;a&amp;#34;
            match = &amp;#34;=&amp;#34;
            value = &amp;#34;b&amp;#34;
        }
        group_by = [&amp;#34;...&amp;#34;]
        contact_point = grafana_contact_point.a_different_contact_point.name
        mute_timings = [grafana_mute_timing.my_mute_timing.name]

        policy {
            matcher {
                label = &amp;#34;sublabel&amp;#34;
                match = &amp;#34;=&amp;#34;
                value = &amp;#34;subvalue&amp;#34;
            }
            contact_point = grafana_contact_point.a_third_contact_point.name
            group_by = [&amp;#34;...&amp;#34;]
        }
    }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;
&lt;p&gt;In the mute_timings field, link a mute timing to your notification policy.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the command ‘terraform apply’.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Go to the Grafana UI and check the details of your notification policy.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You cannot edit resources provisioned from Terraform from the UI. This ensures that your alerting stack always stays in sync with your code.&lt;/p&gt;
&lt;ol start=&#34;5&#34;&gt;
&lt;li&gt;Click &lt;strong&gt;Test&lt;/strong&gt; to verify that the notification point is working correctly.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;provision-mute-timings&#34;&gt;Provision mute timings&lt;/h2&gt;
&lt;p&gt;Mute timings provide the ability to mute alert notifications for defined time periods.&lt;/p&gt;
&lt;p&gt;To provision mute timings, complete the following steps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Copy this code block into a .tf file on your local machine.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In this example, alert notifications are muted on weekends.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;terraform&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-terraform&#34;&gt;resource &amp;#34;grafana_mute_timing&amp;#34; &amp;#34;my_mute_timing&amp;#34; {
    name = &amp;#34;My Mute Timing&amp;#34;

    intervals {
        times {
          start = &amp;#34;04:56&amp;#34;
          end = &amp;#34;14:17&amp;#34;
        }
        weekdays = [&amp;#34;saturday&amp;#34;, &amp;#34;sunday&amp;#34;, &amp;#34;tuesday:thursday&amp;#34;]
        months = [&amp;#34;january:march&amp;#34;, &amp;#34;12&amp;#34;]
        years = [&amp;#34;2025:2027&amp;#34;]
    }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;Run the command ‘terraform apply’.&lt;/li&gt;
&lt;li&gt;Go to the Grafana UI and check the details of your mute timing.&lt;/li&gt;
&lt;li&gt;Reference your newly created mute timing in a notification policy using the &lt;code&gt;mute_timings&lt;/code&gt; field.
This will apply your mute timing to some or all of your notifications.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You cannot edit resources provisioned from Terraform from the UI. This ensures that your alerting stack always stays in sync with your code.&lt;/p&gt;
&lt;ol start=&#34;5&#34;&gt;
&lt;li&gt;Click &lt;strong&gt;Test&lt;/strong&gt; to verify that the mute timing is working correctly.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;provision-alert-rules&#34;&gt;Provision alert rules&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;/docs/grafana/latest/alerting/alerting-rules/&#34;&gt;Alert rules&lt;/a&gt; enable you to alert against any Grafana data source. This can be a data source that you already have configured, or you can &lt;a href=&#34;https://registry.terraform.io/providers/grafana/grafana/latest/docs/resources/data_source&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;define your data sources in Terraform&lt;/a&gt; alongside your alert rules.&lt;/p&gt;
&lt;p&gt;To provision alert rules, complete the following steps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a data source to query and a folder to store your rules in.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In this example, the &lt;a href=&#34;/docs/grafana/latest/datasources/testdata/&#34;&gt;TestData&lt;/a&gt; data source is used.&lt;/p&gt;
&lt;p&gt;Alerts can be defined against any backend datasource in Grafana.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;terraform&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-terraform&#34;&gt;resource &amp;#34;grafana_data_source&amp;#34; &amp;#34;testdata_datasource&amp;#34; {
    name = &amp;#34;TestData&amp;#34;
    type = &amp;#34;testdata&amp;#34;
}

resource &amp;#34;grafana_folder&amp;#34; &amp;#34;rule_folder&amp;#34; {
    title = &amp;#34;My Rule Folder&amp;#34;
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;Define an alert rule.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For more information on alert rules, refer to &lt;a href=&#34;/blog/2022/08/01/grafana-alerting-video-how-to-create-alerts-in-grafana-9/&#34;&gt;how to create Grafana-managed alerts&lt;/a&gt;.&lt;/p&gt;
&lt;ol start=&#34;3&#34;&gt;
&lt;li&gt;Create a rule group containing one or more rules.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In this example, the &lt;code&gt;grafana_rule_group&lt;/code&gt; resource group is used.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;terraform&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-terraform&#34;&gt;resource &amp;#34;grafana_rule_group&amp;#34; &amp;#34;my_rule_group&amp;#34; {
    name = &amp;#34;My Alert Rules&amp;#34;
    folder_uid = grafana_folder.rule_folder.uid
    interval_seconds = 60
    org_id = 1

    rule {
        name = &amp;#34;My Random Walk Alert&amp;#34;
        condition = &amp;#34;C&amp;#34;
        for = &amp;#34;0s&amp;#34;

        // Query the datasource.
        data {
            ref_id = &amp;#34;A&amp;#34;
            relative_time_range {
                from = 600
                to = 0
            }
            datasource_uid = grafana_data_source.testdata_datasource.uid
            // `model` is a JSON blob that sends datasource-specific data.
            // It&amp;#39;s different for every datasource. The alert&amp;#39;s query is defined here.
            model = jsonencode({
                intervalMs = 1000
                maxDataPoints = 43200
                refId = &amp;#34;A&amp;#34;
            })
        }

        // The query was configured to obtain data from the last 60 seconds. Let&amp;#39;s alert on the average value of that series using a Reduce stage.
        data {
            datasource_uid = &amp;#34;__expr__&amp;#34;
            // You can also create a rule in the UI, then GET that rule to obtain the JSON.
            // This can be helpful when using more complex reduce expressions.
            model = &amp;lt;&amp;lt;EOT
{&amp;#34;conditions&amp;#34;:[{&amp;#34;evaluator&amp;#34;:{&amp;#34;params&amp;#34;:[0,0],&amp;#34;type&amp;#34;:&amp;#34;gt&amp;#34;},&amp;#34;operator&amp;#34;:{&amp;#34;type&amp;#34;:&amp;#34;and&amp;#34;},&amp;#34;query&amp;#34;:{&amp;#34;params&amp;#34;:[&amp;#34;A&amp;#34;]},&amp;#34;reducer&amp;#34;:{&amp;#34;params&amp;#34;:[],&amp;#34;type&amp;#34;:&amp;#34;last&amp;#34;},&amp;#34;type&amp;#34;:&amp;#34;avg&amp;#34;}],&amp;#34;datasource&amp;#34;:{&amp;#34;name&amp;#34;:&amp;#34;Expression&amp;#34;,&amp;#34;type&amp;#34;:&amp;#34;__expr__&amp;#34;,&amp;#34;uid&amp;#34;:&amp;#34;__expr__&amp;#34;},&amp;#34;expression&amp;#34;:&amp;#34;A&amp;#34;,&amp;#34;hide&amp;#34;:false,&amp;#34;intervalMs&amp;#34;:1000,&amp;#34;maxDataPoints&amp;#34;:43200,&amp;#34;reducer&amp;#34;:&amp;#34;last&amp;#34;,&amp;#34;refId&amp;#34;:&amp;#34;B&amp;#34;,&amp;#34;type&amp;#34;:&amp;#34;reduce&amp;#34;}
EOT
            ref_id = &amp;#34;B&amp;#34;
            relative_time_range {
                from = 0
                to = 0
            }
        }

        // Now, let&amp;#39;s use a math expression as our threshold.
        // We want to alert when the value of stage &amp;#34;B&amp;#34; above exceeds 70.
        data {
            datasource_uid = &amp;#34;__expr__&amp;#34;
            ref_id = &amp;#34;C&amp;#34;
            relative_time_range {
                from = 0
                to = 0
            }
            model = jsonencode({
                expression = &amp;#34;$B &amp;gt; 70&amp;#34;
                type = &amp;#34;math&amp;#34;
                refId = &amp;#34;C&amp;#34;
            })
        }
    }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ol start=&#34;4&#34;&gt;
&lt;li&gt;Go to the Grafana UI and check your alert rule.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can see whether or not the alert rule is firing. You can also see a visualization of each of the alert rule’s query stages&lt;/p&gt;
&lt;p&gt;When the alert fires, Grafana routes a notification through the policy you defined.&lt;/p&gt;
&lt;p&gt;For example, if you chose Slack as a contact point, Grafana’s embedded &lt;a href=&#34;https://github.com/prometheus/alertmanager&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Alertmanager&lt;/a&gt; automatically posts a message to Slack.&lt;/p&gt;
]]></content><description>&lt;h1 id="create-and-manage-alerting-resources-using-terraform">Create and manage alerting resources using Terraform&lt;/h1>
&lt;p>Use Terraform’s Grafana Provider to manage your alerting resources and provision them into your Grafana system. Terraform provider support for Grafana Alerting makes it easy to create, manage, and maintain your entire Grafana Alerting stack as code.&lt;/p></description></item><item><title>View provisioned resources in Grafana</title><link>https://grafana.com/docs/grafana/v9.5/alerting/set-up/provision-alerting-resources/view-provisioned-resources/</link><pubDate>Mon, 16 Mar 2026 00:39:39 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.5/alerting/set-up/provision-alerting-resources/view-provisioned-resources/</guid><content><![CDATA[&lt;h1 id=&#34;view-provisioned-alerting-resources-in-grafana&#34;&gt;View provisioned alerting resources in Grafana&lt;/h1&gt;
&lt;p&gt;Verify that your alerting resources were created in Grafana.&lt;/p&gt;
&lt;p&gt;To view your provisioned resources in Grafana, complete the following steps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open your Grafana instance.&lt;/li&gt;
&lt;li&gt;Navigate to Alerting.&lt;/li&gt;
&lt;li&gt;Click an alerting resource folder, for example, Alert rules.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Provisioned resources are labeled &lt;strong&gt;Provisioned&lt;/strong&gt;, so that it is clear that they were not created manually.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You cannot edit provisioned resources from Grafana. You can only change the resource properties by changing the provisioning file and restarting Grafana or carrying out a hot reload. This prevents changes being made to the resource that would be overwritten if a file is provisioned again or a hot reload is carried out.&lt;/p&gt;
]]></content><description>&lt;h1 id="view-provisioned-alerting-resources-in-grafana">View provisioned alerting resources in Grafana&lt;/h1>
&lt;p>Verify that your alerting resources were created in Grafana.&lt;/p>
&lt;p>To view your provisioned resources in Grafana, complete the following steps.&lt;/p></description></item></channel></rss>