"""Lambda entrypoints. AWS Lambda handler paths: fan_fanout → app.runtime.main.fan_fanout fan_collect → app.runtime.main.fan_collect rotate_keys → app.runtime.main.rotate_keys prepare_rotation → app.runtime.main.prepare_rotation fan_fanout is triggered by EventBridge Scheduler. fan_collect is triggered by SQS (requires ReportBatchItemFailures on the event source mapping). rotate_keys / prepare_rotation are invoked manually from Jenkins during Fernet key rotation. """ import logging.config from typing import Any import rich from app.config import settings from . import handlers from .handlers import ( FanCollectResult, FanFanoutResult, FanFanoutSkippedResult, PrepareRotationResult, RotateKeysResult, ) if settings.logging_debug: rich.reconfigure(force_terminal=True) logging.config.dictConfig(settings.logging_config) def fan_fanout( event: dict[str, Any], context: Any ) -> FanFanoutResult | FanFanoutSkippedResult: return handlers.fan_fanout_handler(event, context) def fan_collect(event: dict[str, Any], context: Any) -> FanCollectResult: return handlers.fan_collect_handler(event, context) def prepare_rotation(event: dict[str, Any], context: Any) -> PrepareRotationResult: return handlers.prepare_rotation_handler(event, context) def rotate_keys(event: dict[str, Any], context: Any) -> RotateKeysResult: return handlers.rotate_keys_handler(event, context)