@@ -189,6 +189,7 @@ func TestAccSumologicMonitorsLibraryMonitor_create(t *testing.T) {
189189 },
190190 }
191191 testAlertName := "Alert from {{Name}}"
192+ testGroupFields := [2 ]string {"groupingField1" , "groupingField2" }
192193
193194 resource .Test (t , resource.TestCase {
194195 PreCheck : func () { testAccPreCheck (t ) },
@@ -212,6 +213,8 @@ func TestAccSumologicMonitorsLibraryMonitor_create(t *testing.T) {
212213 resource .TestCheckResourceAttr ("sumologic_monitor.test" , "triggers.0.time_range" , testTriggers [0 ].TimeRange ),
213214 resource .TestCheckResourceAttr ("sumologic_monitor.test" , "notifications.0.notification.0.connection_type" , testNotifications [0 ].Notification .(EmailNotification ).ConnectionType ),
214215 resource .TestCheckResourceAttr ("sumologic_monitor.test" , "alert_name" , testAlertName ),
216+ resource .TestCheckResourceAttr ("sumologic_monitor.test" , "notification_group_fields.0" , testGroupFields [0 ]),
217+ resource .TestCheckResourceAttr ("sumologic_monitor.test" , "notification_group_fields.1" , testGroupFields [1 ]),
215218 resource .TestCheckResourceAttr ("sumologic_monitor.test" , "obj_permission.#" , "2" ),
216219 testAccCheckMonitorsLibraryMonitorFGPBackend ("sumologic_monitor.test" , t , genExpectedPermStmtsMonitor ),
217220 ),
@@ -308,6 +311,7 @@ func TestAccSumologicMonitorsLibraryMonitor_update(t *testing.T) {
308311 },
309312 }
310313 testAlertName := "Alert from {{Name}}"
314+ testGroupFields := [2 ]string {"groupingField1" , "groupingField2" }
311315
312316 // updated fields
313317 testUpdatedName := "terraform_test_monitor_" + testNameSuffix
@@ -368,6 +372,7 @@ func TestAccSumologicMonitorsLibraryMonitor_update(t *testing.T) {
368372 },
369373 }
370374 testUpdatedAlertName := "Updated Alert from {{Name}}"
375+ testUpdatedGroupFields := [2 ]string {"groupingField3" , "groupingField4" }
371376
372377 resource .Test (t , resource.TestCase {
373378 PreCheck : func () { testAccPreCheck (t ) },
@@ -392,6 +397,8 @@ func TestAccSumologicMonitorsLibraryMonitor_update(t *testing.T) {
392397 resource .TestCheckResourceAttr ("sumologic_monitor.test" , "notifications.0.notification.0.connection_type" , testNotifications [0 ].Notification .(EmailNotification ).ConnectionType ),
393398 resource .TestCheckResourceAttr ("sumologic_monitor.test" , "playbook" , testPlaybook ),
394399 resource .TestCheckResourceAttr ("sumologic_monitor.test" , "alert_name" , testAlertName ),
400+ resource .TestCheckResourceAttr ("sumologic_monitor.test" , "notification_group_fields.0" , testGroupFields [0 ]),
401+ resource .TestCheckResourceAttr ("sumologic_monitor.test" , "notification_group_fields.1" , testGroupFields [1 ]),
395402 resource .TestCheckResourceAttr ("sumologic_monitor.test" , "obj_permission.#" , "2" ),
396403 testAccCheckMonitorsLibraryMonitorFGPBackend ("sumologic_monitor.test" , t , genExpectedPermStmtsMonitor ),
397404 ),
@@ -412,6 +419,8 @@ func TestAccSumologicMonitorsLibraryMonitor_update(t *testing.T) {
412419 resource .TestCheckResourceAttr ("sumologic_monitor.test" , "notifications.0.notification.0.connection_type" , testUpdatedNotifications [0 ].Notification .(EmailNotification ).ConnectionType ),
413420 resource .TestCheckResourceAttr ("sumologic_monitor.test" , "playbook" , testUpdatedPlaybook ),
414421 resource .TestCheckResourceAttr ("sumologic_monitor.test" , "alert_name" , testUpdatedAlertName ),
422+ resource .TestCheckResourceAttr ("sumologic_monitor.test" , "notification_group_fields.0" , testUpdatedGroupFields [0 ]),
423+ resource .TestCheckResourceAttr ("sumologic_monitor.test" , "notification_group_fields.1" , testUpdatedGroupFields [1 ]),
415424 resource .TestCheckResourceAttr ("sumologic_monitor.test" , "obj_permission.#" , "1" ),
416425 // 1, instead of 2
417426 testAccCheckMonitorsLibraryMonitorFGPBackend ("sumologic_monitor.test" , t , genExpectedPermStmtsForMonitorUpdate ),
@@ -674,6 +683,7 @@ resource "sumologic_monitor" "test" {
674683 }
675684 playbook = "This is a test playbook"
676685 alert_name = "Alert from {{Name}}"
686+ notification_group_fields = ["groupingField1", "groupingField2"]
677687 obj_permission {
678688 subject_type = "role"
679689 subject_id = sumologic_role.tf_test_role_01.id
@@ -758,6 +768,7 @@ resource "sumologic_monitor" "test" {
758768 }
759769 playbook = "This is an updated test playbook"
760770 alert_name = "Updated Alert from {{Name}}"
771+ notification_group_fields = ["groupingField3", "groupingField4"]
761772 obj_permission {
762773 subject_type = "role"
763774 subject_id = sumologic_role.tf_test_role_01.id
0 commit comments