Skip to content

Commit 0a30e5b

Browse files
authored
[PRMT-612] Removing lambda triggers for data collection and statistical report (#442)
1 parent b340e6f commit 0a30e5b

1 file changed

Lines changed: 0 additions & 58 deletions

File tree

infrastructure/schedules.tf

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -57,64 +57,6 @@ resource "aws_lambda_permission" "bulk_upload_report_schedule_permission" {
5757
]
5858
}
5959

60-
resource "aws_cloudwatch_event_rule" "data_collection_schedule" {
61-
name = "${terraform.workspace}_data_collection_schedule"
62-
description = "Schedule for Data Collection Lambda"
63-
schedule_expression = "cron(0 20 ? * SAT *)"
64-
}
65-
66-
resource "aws_cloudwatch_event_target" "data_collection_schedule_event" {
67-
rule = aws_cloudwatch_event_rule.data_collection_schedule.name
68-
target_id = "data_collection_schedule"
69-
70-
arn = module.data-collection-lambda.lambda_arn
71-
depends_on = [
72-
module.data-collection-lambda,
73-
aws_cloudwatch_event_rule.data_collection_schedule
74-
]
75-
}
76-
77-
resource "aws_lambda_permission" "data_collection_schedule_permission" {
78-
statement_id = "AllowExecutionFromCloudWatch"
79-
action = "lambda:InvokeFunction"
80-
function_name = module.data-collection-lambda.function_name
81-
principal = "events.amazonaws.com"
82-
source_arn = aws_cloudwatch_event_rule.data_collection_schedule.arn
83-
depends_on = [
84-
module.data-collection-lambda,
85-
aws_cloudwatch_event_rule.data_collection_schedule
86-
]
87-
}
88-
89-
resource "aws_cloudwatch_event_rule" "statistical_report_schedule" {
90-
name = "${terraform.workspace}_statistical_report_schedule"
91-
description = "Schedule for Statistical Report Lambda"
92-
schedule_expression = "cron(0 8 ? * MON *)"
93-
}
94-
95-
resource "aws_cloudwatch_event_target" "statistical_report_schedule_event" {
96-
rule = aws_cloudwatch_event_rule.statistical_report_schedule.name
97-
target_id = "statistical_report_schedule"
98-
99-
arn = module.statistical-report-lambda.lambda_arn
100-
depends_on = [
101-
module.statistical-report-lambda,
102-
aws_cloudwatch_event_rule.statistical_report_schedule
103-
]
104-
}
105-
106-
resource "aws_lambda_permission" "statistical_report_schedule_permission" {
107-
statement_id = "AllowExecutionFromCloudWatch"
108-
action = "lambda:InvokeFunction"
109-
function_name = module.statistical-report-lambda.function_name
110-
principal = "events.amazonaws.com"
111-
source_arn = aws_cloudwatch_event_rule.statistical_report_schedule.arn
112-
depends_on = [
113-
module.statistical-report-lambda,
114-
aws_cloudwatch_event_rule.statistical_report_schedule
115-
]
116-
}
117-
11860
resource "aws_scheduler_schedule" "data_collection_ecs" {
11961
count = local.is_sandbox ? 0 : 1
12062
name_prefix = "${terraform.workspace}_data_collection_ecs"

0 commit comments

Comments
 (0)