@faceteer/cdk
Version:
CDK 2.0 constructs and helpers that make composing a Lambda powered service easier.
19 lines (18 loc) • 661 B
TypeScript
import { Schedule } from 'aws-cdk-lib/aws-events';
import { HandlerDefinition, HandlerTypes } from './handler';
import type { ScheduledHandler } from 'aws-lambda';
export interface CronHandlerDefinition extends HandlerDefinition {
name: string;
schedule: Pick<Schedule, 'expressionString'>;
}
export type CronHandlerWithDefinition = ScheduledHandler & {
type: HandlerTypes.Cron;
definition: CronHandlerDefinition;
};
/**
* Creates a handler that will run on a schedule
* @param options
* @param handler
* @returns
*/
export declare function CronHandler(options: CronHandlerDefinition, handler: ScheduledHandler): CronHandlerWithDefinition;