Skip to content

Commit

Permalink
uncomment event rules
Browse files Browse the repository at this point in the history
  • Loading branch information
tajewole-moj committed Oct 20, 2023
1 parent 1b7b1e5 commit aa56696
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions terraform/environments/apex/modules/lambda/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
# }

# 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
# }

0 comments on commit aa56696

Please sign in to comment.