aboutsummaryrefslogtreecommitdiffstats
path: root/terraform/events.tf
diff options
context:
space:
mode:
Diffstat (limited to 'terraform/events.tf')
-rw-r--r--terraform/events.tf18
1 files changed, 10 insertions, 8 deletions
diff --git a/terraform/events.tf b/terraform/events.tf
index 6744085..9fd89e4 100644
--- a/terraform/events.tf
+++ b/terraform/events.tf
@@ -1,7 +1,17 @@
+resource "aws_cloudwatch_event_target" "extract_lambda_cw_event" {
+ rule = aws_cloudwatch_event_rule.lambda_trigger.name
+ target_id = "TargetFunctionV1"
+ arn = aws_lambda_function.extract_lambda.arn #replaced lambda name placeholder
+ force_destroy = true
+}
+
resource "aws_cloudwatch_event_rule" "lambda_trigger" {
name = "lambda-scheduled-trigger"
description = "Schedule to trigger the Lambda function"
schedule_expression = "rate(30 minutes)"
+ force_destroy = true
+ # depends_on = [
+ # aws_cloudwatch_event_target.extract_lambda_cw_event]
# event_pattern = jsonencode({
# detail-type =
@@ -10,14 +20,6 @@ resource "aws_cloudwatch_event_rule" "lambda_trigger" {
# })
}
-
-resource "aws_cloudwatch_event_target" "extract_lambda_cw_event" {
- rule = aws_cloudwatch_event_rule.lambda_trigger.name
- target_id = "TargetFunctionV1"
- arn = aws_lambda_function.extract_lambda.arn #replaced lambda name placeholder
-}
-
-
resource "aws_lambda_permission" "allow_eventbridge" {
statement_id = "AllowExecutionFromEventBridge"
action = "lambda:InvokeFunction"
git.ajschof.me — hosted by ajschofield — powered by cgit