@@ -417,6 +417,59 @@ resource "sumologic_monitor" "tf_example_metrics_anomaly_monitor" {
417417}
418418```
419419
420+ ## Example Monitor with linked Playbook
421+ ``` hcl
422+ resource "sumologic_monitor" "tf_monitor_with_playbook" {
423+ name = "Terraform Monitor with Playbook"
424+ description = "tf monitor with Playbook"
425+ type = "MonitorsLibraryMonitor"
426+ is_disabled = false
427+ content_type = "Monitor"
428+ monitor_type = "Metrics"
429+ evaluation_delay = "1m"
430+ tags = {
431+ "team" = "monitoring"
432+ "application" = "sumologic"
433+ }
434+
435+ queries {
436+ row_id = "A"
437+ query = "metric=CPU* _sourceCategory=event-action"
438+ }
439+
440+ trigger_conditions {
441+ metrics_static_condition {
442+ critical {
443+ time_range = "15m"
444+ occurrence_type = "Always"
445+ alert {
446+ threshold = 40.0
447+ threshold_type = "GreaterThan"
448+ min_data_points = 5
449+ }
450+ resolution {
451+ threshold = 40.0
452+ threshold_type = "LessThanOrEqual"
453+ }
454+ }
455+ }
456+ }
457+ notifications {
458+ notification {
459+ connection_type = "Email"
460+ recipients = ["[email protected] "] 461+ subject = "Triggered {{TriggerType}} Alert on Monitor {{Name}}"
462+ time_zone = "PST"
463+ message_body = "Triggered {{TriggerType}} Alert on {{Name}}: {{QueryURL}}"
464+ }
465+ run_for_trigger_types = ["Critical", "ResolvedCritical"]
466+ }
467+ playbook = "test playbook"
468+ automated_playbook_ids = ["000000000000000000000foo"]
469+ notification_group_fields = ["metric"]
470+ }
471+ ```
472+
420473## Monitor Folders
421474
422475NOTE: Monitor folders are considered a different resource from Library content folders. See [ sumologic_monitor_folder] [ 2 ] for more details.
0 commit comments