Skip to content

Commit

Permalink
Merge pull request #88 from SumoLogic/rohit-combined-monitors-fixes
Browse files Browse the repository at this point in the history
monitors fixes
  • Loading branch information
seansain authored Sep 29, 2020
2 parents 9f8dabc + ce42517 commit b8eefe1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
12 changes: 10 additions & 2 deletions sumologic/resource_sumologic_monitors_library_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,12 @@ func resourceSumologicMonitorsLibraryMonitor() *schema.Resource {
Optional: true,
},
"status": {
Type: schema.TypeString,
Type: schema.TypeList,
Optional: true,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"group_notifications": {
Type: schema.TypeBool,
Expand Down Expand Up @@ -366,6 +369,11 @@ func resourceToMonitorsLibraryMonitor(d *schema.ResourceData) MonitorsLibraryMon
q.RowID = queryDict["row_id"].(string)
queries[i] = q
}
rawStatus := d.Get("status").([]interface{})
status := make([]string, len(rawStatus))
for i := range rawStatus {
status[i] = rawStatus[i].(string)
}

return MonitorsLibraryMonitor{
CreatedBy: d.Get("created_by").(string),
Expand All @@ -387,7 +395,7 @@ func resourceToMonitorsLibraryMonitor(d *schema.ResourceData) MonitorsLibraryMon
IsLocked: d.Get("is_locked").(bool),
IsSystem: d.Get("is_system").(bool),
IsDisabled: d.Get("is_disabled").(bool),
Status: d.Get("status").(string),
Status: status,
GroupNotifications: d.Get("group_notifications").(bool),
}
}
2 changes: 1 addition & 1 deletion sumologic/sumologic_monitors_library_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ type MonitorsLibraryMonitor struct {
ContentType string `json:"contentType"`
ModifiedBy string `json:"modifiedBy"`
IsDisabled bool `json:"isDisabled"`
Status string `json:"status"`
Status []string `json:"status"`
GroupNotifications bool `json:"groupNotifications"`
}

Expand Down
1 change: 0 additions & 1 deletion website/docs/r/monitor.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ resource "sumologic_monitor" "tf_metrics_monitor_1" {
detection_method = "StaticCondition"
}
notifications {
notification_type = "EmailAction"
notification {
action_type = "EmailAction"
recipients = ["[email protected]"]
Expand Down

0 comments on commit b8eefe1

Please sign in to comment.