11resource aws_cloudwatch_event_rule slowlog_check {
22 name_prefix = " slowlog_check_every_minute"
3- description = " Check for slowlogs every five minutes "
3+ description = " Check for slowlogs every minute "
44 schedule_expression = " rate(1 minute)"
55 tags = var. tags
66}
@@ -94,13 +94,6 @@ resource aws_security_group egress {
9494 tags = var. tags
9595}
9696
97- resource null_resource get_slowlog_check_archive {
98- provisioner local-exec {
99- command = " wget https://github.com/scribd/elasticache-slowlog-to-datadog/releases/download/v1.0.1/slowlog_check.1.0.1.zip"
100- working_dir = path. module
101- }
102- }
103-
10497resource aws_ssm_parameter datadog_api_key {
10598 name = " /${ var . ssm_path } /DATADOG_API_KEY"
10699 description = " Datadog API Key"
@@ -120,8 +113,8 @@ resource aws_ssm_parameter datadog_app_key {
120113
121114resource "aws_lambda_function" "slowlog_check" {
122115 function_name = " slowlog_check"
123- filename = " ${ path . module } /slowlog_check.1.0.1.zip "
124- source_code_hash = " Xn5bMbrSmVqdHMjchEAk/r2TJT6cHdQfIXRIaZo7vdQ= "
116+ filename = local . slowlog_check_archive_path
117+ source_code_hash = local . slowlog_check_archive_hash
125118 role = aws_iam_role. slowlog_check . arn
126119 handler = " lambda_function.lambda_handler"
127120 runtime = " ruby2.5"
@@ -141,8 +134,7 @@ resource "aws_lambda_function" "slowlog_check" {
141134 }
142135 }
143136
144- tags = var. tags
145- depends_on = [null_resource. get_slowlog_check_archive ]
137+ tags = var. tags
146138}
147139
148140resource aws_lambda_function_event_invoke_config slowlog_check {
0 commit comments