resource "aws_scheduler_schedule" "dra_check_orphan_group_process_status" {
  #checkov:skip=CKV_AWS_297: Ensure EventBridge Scheduler Schedule uses Customer Managed Key (CMK)
  name        = "dra-check-orphan-group-process-status"
  description = "Daily scheduler for dra_check_orphan_group_process_status Lambda."

  schedule_expression = "cron(0 9 * * ? *)"
  schedule_expression_timezone = "America/New_York"

  start_date = "2026-02-16T14:00:00Z" # 09:00 (UTC-05)

  flexible_time_window {
    mode = "OFF"
  }

  target {
    arn          = "arn:aws:lambda:eu-central-1:${var.account_id}:function:Dra-Clr-Perf"
    role_arn     = "arn:aws:iam::${var.account_id}:role/dra-orphan-lambda-scheduler-role"
    input = jsonencode({
      key = "FindOrphanGroupProcessStatus"
    })
  }
}