Skip to content

Commit efb8ea9

Browse files
Document that the notification policy is a singleton (#644)
This is a question that has come up a couple times since the alerting release Closes #642
1 parent 036f739 commit efb8ea9

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

docs/resources/notification_policy.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
page_title: "grafana_notification_policy Resource - terraform-provider-grafana"
44
subcategory: "Alerting"
55
description: |-
6-
Official documentation https://grafana.com/docs/grafana/latest/alerting/notifications/HTTP API https://grafana.com/docs/grafana/next/developers/http_api/alerting_provisioning/#notification-policies
6+
Sets the global notification policy for Grafana. Note that this resource manages the entire notification policy tree, and will overwrite any existing policies.
7+
* Official documentation https://grafana.com/docs/grafana/latest/alerting/notifications/
8+
* HTTP API https://grafana.com/docs/grafana/next/developers/http_api/alerting_provisioning/#notification-policies
79
---
810

911
# grafana_notification_policy (Resource)
1012

13+
Sets the global notification policy for Grafana. Note that this resource manages the entire notification policy tree, and will overwrite any existing policies.
1114
* [Official documentation](https://grafana.com/docs/grafana/latest/alerting/notifications/)
1215
* [HTTP API](https://grafana.com/docs/grafana/next/developers/http_api/alerting_provisioning/#notification-policies)
1316

@@ -212,5 +215,6 @@ Required:
212215
Import is supported using the following syntax:
213216

214217
```shell
215-
terraform import grafana_notification_policy.notification_policy_name {{notification_policy_name}}
218+
# The policy is a singleton, so the ID is a constant "policy" value.
219+
terraform import grafana_notification_policy.notification_policy_name "policy"
216220
```
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
terraform import grafana_notification_policy.notification_policy_name {{notification_policy_name}}
1+
# The policy is a singleton, so the ID is a constant "policy" value.
2+
terraform import grafana_notification_policy.notification_policy_name "policy"

grafana/resource_alerting_notification_policy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
func ResourceNotificationPolicy() *schema.Resource {
1313
return &schema.Resource{
1414
Description: `
15+
Sets the global notification policy for Grafana. Note that this resource manages the entire notification policy tree, and will overwrite any existing policies.
1516
* [Official documentation](https://grafana.com/docs/grafana/latest/alerting/notifications/)
1617
* [HTTP API](https://grafana.com/docs/grafana/next/developers/http_api/alerting_provisioning/#notification-policies)
1718
`,

0 commit comments

Comments
 (0)