From aa566969485ce6d6af6e674923e6d7a4e40e1999 Mon Sep 17 00:00:00 2001 From: tajewole-moj Date: Fri, 20 Oct 2023 11:11:06 +0100 Subject: [PATCH] uncomment event rules --- .../environments/apex/modules/lambda/main.tf | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/terraform/environments/apex/modules/lambda/main.tf b/terraform/environments/apex/modules/lambda/main.tf index 3414d9980b0..4d40474f236 100644 --- a/terraform/environments/apex/modules/lambda/main.tf +++ b/terraform/environments/apex/modules/lambda/main.tf @@ -29,27 +29,27 @@ resource "aws_lambda_function" "snapshotDBFunction" { # } } -resource "aws_cloudwatch_event_rule" "mon_sun" { - name = "laa-createSnapshotRule-LWN8E1LNHFJR" - description = "Fires every five minutes" - schedule_expression = "cron(15 11 ? * MON-SUN *)" +# resource "aws_cloudwatch_event_rule" "mon_sun" { +# name = "laa-createSnapshotRule-LWN8E1LNHFJR" +# description = "Fires every five minutes" +# schedule_expression = "cron(15 11 ? * MON-SUN *)" -} +# } -resource "aws_cloudwatch_event_target" "check_mon_sun" { - count = 1 - rule = aws_cloudwatch_event_rule.mon_sun.name - arn = "${aws_lambda_function.snapshotDBFunction[0].arn}" - input = {"appname": "apex Database Server"} +# resource "aws_cloudwatch_event_target" "check_mon_sun" { +# count = 1 +# rule = aws_cloudwatch_event_rule.mon_sun.name +# arn = "${aws_lambda_function.snapshotDBFunction[0].arn}" +# input = {"appname": "apex Database Server"} -} - -resource "aws_lambda_permission" "allow_cloudwatch_to_call_check_mon_sun" { - count = 1 - statement_id = "AllowExecutionFromCloudWatch" - action = "lambda:InvokeFunction" - function_name = aws_lambda_function.snapshotDBFunction[0].function_name - principal = "events.amazonaws.com" - source_arn = aws_cloudwatch_event_rule.mon_sun.arn -} \ No newline at end of file +# } + +# resource "aws_lambda_permission" "allow_cloudwatch_to_call_check_mon_sun" { +# count = 1 +# statement_id = "AllowExecutionFromCloudWatch" +# action = "lambda:InvokeFunction" +# function_name = aws_lambda_function.snapshotDBFunction[0].function_name +# principal = "events.amazonaws.com" +# source_arn = aws_cloudwatch_event_rule.mon_sun.arn +# } \ No newline at end of file