Skip to content

Commit 62e4233

Browse files
committed
Only create schedules in prod
1 parent 258d6b2 commit 62e4233

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • ops/services/04-idr-bfd-validator

ops/services/04-idr-bfd-validator/main.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,19 @@ resource "aws_ecs_task_definition" "this" {
204204
}
205205

206206
resource "aws_scheduler_schedule_group" "this" {
207+
# Only run in prod, for now
208+
count = local.env == "prod" ? 1 : 0
209+
207210
name = "${local.name_prefix}-schedules"
208211
}
209212

210213
resource "aws_scheduler_schedule" "this" {
214+
# Only run in prod, for now
215+
count = local.env == "prod" ? 1 : 0
211216
depends_on = [aws_iam_role_policy_attachment.schedule]
212217

213218
name = "${local.name_prefix}-every-1-hour"
214-
group_name = aws_scheduler_schedule_group.this.name
219+
group_name = one(aws_scheduler_schedule_group.this[*].name)
215220

216221
flexible_time_window {
217222
mode = "OFF"

0 commit comments

Comments
 (0)