diff --git a/api/alert_channels_aws_cloudwatch.go b/api/alert_channels_aws_cloudwatch.go index 3cad26a2c..2766afe70 100644 --- a/api/alert_channels_aws_cloudwatch.go +++ b/api/alert_channels_aws_cloudwatch.go @@ -32,7 +32,8 @@ func (svc *AlertChannelsService) UpdateCloudwatchEb(data AlertChannel) (response } type CloudwatchEbDataV2 struct { - EventBusArn string `json:"eventBusArn"` + EventBusArn string `json:"eventBusArn"` + IssueGrouping string `json:"issueGrouping,omitempty"` } type CloudwatchEbAlertChannelV2 struct { diff --git a/api/alert_channels_aws_cloudwatch_test.go b/api/alert_channels_aws_cloudwatch_test.go index b9dad39c5..4d542fdfd 100644 --- a/api/alert_channels_aws_cloudwatch_test.go +++ b/api/alert_channels_aws_cloudwatch_test.go @@ -32,9 +32,10 @@ import ( func TestAlertChannelsService_GetCloudwatchEb(t *testing.T) { var ( - intgGUID = intgguid.New() - apiPath = fmt.Sprintf("AlertChannels/%s", intgGUID) - fakeServer = lacework.MockServer() + intgGUID = intgguid.New() + apiPath = fmt.Sprintf("AlertChannels/%s", intgGUID) + fakeServer = lacework.MockServer() + eventBusArn = "arn:aws:events:YourRegion:YourAccountID:event-bus/default" ) fakeServer.UseApiV2() fakeServer.MockToken("TOKEN") @@ -58,7 +59,8 @@ func TestAlertChannelsService_GetCloudwatchEb(t *testing.T) { assert.Equal(t, intgGUID, response.Data.IntgGuid) assert.Equal(t, "integration_name", response.Data.Name) assert.True(t, response.Data.State.Ok) - assert.Equal(t, response.Data.Data.EventBusArn, "arn:aws:events:YourRegion:YourAccountID:event-bus/default") + assert.Equal(t, eventBusArn, response.Data.Data.EventBusArn) + assert.Equal(t, "Events", response.Data.Data.IssueGrouping) } func TestAlertChannelsService_UpdateCloudwatchEb(t *testing.T) { @@ -109,6 +111,7 @@ func TestAlertChannelsService_UpdateCloudwatchEb(t *testing.T) { assert.Equal(t, intgGUID, response.Data.IntgGuid) assert.True(t, response.Data.State.Ok) assert.Equal(t, eventBusArn, response.Data.Data.EventBusArn) + assert.Equal(t, "Events", response.Data.Data.IssueGrouping) } func singleAWSCloudwatchAlertChannel(id string) string { @@ -117,7 +120,8 @@ func singleAWSCloudwatchAlertChannel(id string) string { "createdOrUpdatedBy": "vatasha.white@lacework.net", "createdOrUpdatedTime": "2021-09-29T117:55:47.277316", "data": { - "eventBusArn": "arn:aws:events:YourRegion:YourAccountID:event-bus/default" + "eventBusArn": "arn:aws:events:YourRegion:YourAccountID:event-bus/default", + "issueGrouping": "Events" }, "enabled": 1, "intgGuid": %q,