Skip to content

Commit

Permalink
Merge pull request #142 from wri/new-glad-schedule
Browse files Browse the repository at this point in the history
stagger VIIRS and GLAD cron schedules
  • Loading branch information
solomon-negusse authored Apr 25, 2024
2 parents 4888c72 + 1a04333 commit bf4b13d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion terraform/modules/datapump/cloudwatch.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ resource "aws_cloudwatch_event_rule" "everyday-11-pm-est" {
tags = local.tags
}

resource "aws_cloudwatch_event_rule" "everyday-10-pm-est" {
name = substr("everyday-10-pm-est${local.name_suffix}", 0, 64)
description = "Run everyday at 10 pm EST"
schedule_expression = "cron(0 6 ? * * *)"
tags = local.tags
}

resource "aws_cloudwatch_event_rule" "everyday-7-pm-est" {
name = substr("everyday-7-pm-est${local.name_suffix}", 0, 64)
description = "Run everyday at 7 pm EST"
Expand Down Expand Up @@ -38,7 +45,7 @@ resource "aws_cloudwatch_event_target" "sync-deforestation-alerts" {
}

resource "aws_cloudwatch_event_target" "sync-glad" {
rule = aws_cloudwatch_event_rule.everyday-11-pm-est.name
rule = aws_cloudwatch_event_rule.everyday-10-pm-est.name
target_id = substr("${local.project}-sync-glad${local.name_suffix}", 0, 64)
arn = aws_sfn_state_machine.datapump.id
input = "{\"command\": \"sync\", \"parameters\": {\"types\": [\"glad\"]}}"
Expand Down

0 comments on commit bf4b13d

Please sign in to comment.