Skip to content

Commit

Permalink
Adding a saved cloudwatch query definition to the scp violation repor…
Browse files Browse the repository at this point in the history
…t service (#430)
  • Loading branch information
sylviamclaughlin authored Feb 20, 2024
1 parent 56e7fc0 commit 70b2e86
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions terragrunt/aws/csp_violation_report_service/alarms.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,19 @@ resource "aws_cloudwatch_metric_alarm" "csp_report_error" {
alarm_actions = [local.sns_alarm_topic_arn]
ok_actions = [local.sns_alarm_topic_arn]
}


resource "aws_cloudwatch_query_definition" "scp_report_error_query" {
name = "SCP Report Errors"

log_group_names = [
local.csp_reports_log_group_name
]

query_string = <<-QUERY
fields @timestamp, @message, @logStream
| filter @message like /(?i)ERROR/
| sort @timestamp desc
| limit 20
QUERY
}

0 comments on commit 70b2e86

Please sign in to comment.