Skip to content

Commit 92548cf

Browse files
Update to support linking uid to alarms in dashboards
1 parent 03bf2f5 commit 92548cf

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ require (
55
github.com/hashicorp/terraform v0.12.2
66
github.com/nytm/go-grafana-api v0.2.0
77
)
8+
9+
go 1.13

grafana/resource_alert_notification.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ func ResourceAlertNotification() *schema.Resource {
3838
Optional: true,
3939
Sensitive: true,
4040
},
41+
42+
"uid": {
43+
Type: schema.TypeString,
44+
Optional: true,
45+
Required: false,
46+
},
4147
},
4248
}
4349
}
@@ -107,6 +113,7 @@ func ReadAlertNotification(d *schema.ResourceData, meta interface{}) error {
107113
d.Set("name", alertNotification.Name)
108114
d.Set("type", alertNotification.Type)
109115
d.Set("settings", settings)
116+
d.Set("uid", alertNotification.Uid)
110117

111118
return nil
112119
}
@@ -148,6 +155,7 @@ func makeAlertNotification(d *schema.ResourceData) (*gapi.AlertNotification, err
148155
Name: d.Get("name").(string),
149156
Type: d.Get("type").(string),
150157
IsDefault: d.Get("is_default").(bool),
158+
Uid: d.Get("uid").(string),
151159
Settings: settings,
152160
}, err
153161
}

0 commit comments

Comments
 (0)