feat(24-06): wire route53-incremental/route53-full into sync scheduler

- Add route53-incremental and route53-full to the sync_type union
- Seed both schedules disabled (*/15 * * * * incremental, 0 1 * * * full)
- Dispatch branches gate on isRoute53Configured() only (D-10 — no
  integration_settings check, unlike the pax8-daily exception)
- Both branches use dynamic import to keep the AWS SDK out of the
  scheduler's eager module graph
This commit is contained in:
lorentz 2026-08-05 20:30:52 -04:00
parent 2b009573c4
commit fee1f9962b

View file

@ -22,7 +22,7 @@ export interface ScheduleConfig {
name: string; name: string;
description: string; description: string;
cron_expression: string; cron_expression: string;
sync_type: 'incremental' | 'full' | 'veeam-incremental' | 'veeam-full' | 'veeam-rpo-check' | 'contract-services' | 'engagement-daily' | 'zoom-daily' | 'morning-summary' | 'ticket-digest-daily' | 'ticket-digest-weekly' | 'ticket-digest-monthly' | 'device-link-reconcile' | 'integration-health' | 'qbo' | 'mimecast-sync' | 'appgate-sessions' | 'appgate-daily' | 'tickets-reconcile' | 'pax8-daily' | 'phishing-sweep'; sync_type: 'incremental' | 'full' | 'veeam-incremental' | 'veeam-full' | 'veeam-rpo-check' | 'contract-services' | 'engagement-daily' | 'zoom-daily' | 'morning-summary' | 'ticket-digest-daily' | 'ticket-digest-weekly' | 'ticket-digest-monthly' | 'device-link-reconcile' | 'integration-health' | 'qbo' | 'mimecast-sync' | 'appgate-sessions' | 'appgate-daily' | 'tickets-reconcile' | 'pax8-daily' | 'phishing-sweep' | 'route53-incremental' | 'route53-full';
years_back?: number; years_back?: number;
is_enabled: boolean; is_enabled: boolean;
last_run?: Date; last_run?: Date;
@ -307,6 +307,22 @@ class SyncScheduler {
sync_type: 'phishing-sweep', sync_type: 'phishing-sweep',
is_enabled: false, is_enabled: false,
}, },
{
id: 'route53-incremental',
name: 'Route 53 Incremental Sync',
description: 'Syncs AWS Route 53 hosted zones and records every 15 minutes',
cron_expression: '*/15 * * * *',
sync_type: 'route53-incremental',
is_enabled: false,
},
{
id: 'route53-full',
name: 'Route 53 Full Sync',
description: 'Full AWS Route 53 zone and record reconciliation daily at 1:00 AM',
cron_expression: '0 1 * * *',
sync_type: 'route53-full',
is_enabled: false,
},
]; ];
for (const schedule of defaultSchedules) { for (const schedule of defaultSchedules) {
@ -491,6 +507,27 @@ class SyncScheduler {
await getPax8SyncService().fullSync('scheduled'); await getPax8SyncService().fullSync('scheduled');
} }
} }
} else if (config.sync_type === 'route53-incremental') {
// D-10: unlike pax8-daily above, Route 53 dispatch deliberately does
// NOT consult the admin disable toggle — disabling Route 53 in
// /admin/integrations only suppresses health display, it never stops
// sync. PAX8 remains the sole integration where that toggle also
// gates scheduled execution.
const { isRoute53Configured } = await import('@/lib/services/route53-factory');
if (!isRoute53Configured()) {
console.log('[SCHEDULER] Skipping route53-incremental — Route 53 not configured');
} else {
const { getRoute53SyncService } = await import('@/lib/services/route53-sync-service');
await getRoute53SyncService().incrementalSync('scheduled');
}
} else if (config.sync_type === 'route53-full') {
const { isRoute53Configured } = await import('@/lib/services/route53-factory');
if (!isRoute53Configured()) {
console.log('[SCHEDULER] Skipping route53-full — Route 53 not configured');
} else {
const { getRoute53SyncService } = await import('@/lib/services/route53-sync-service');
await getRoute53SyncService().fullSync('scheduled');
}
} else if (config.sync_type === 'mimecast-sync') { } else if (config.sync_type === 'mimecast-sync') {
const { isMimecastConfigured } = await import('@/lib/services/mimecast-client'); const { isMimecastConfigured } = await import('@/lib/services/mimecast-client');
if (!isMimecastConfigured()) { if (!isMimecastConfigured()) {