UNPKG

cdk-rds-scheduler

Version:
54 lines (53 loc) 1.55 kB
import { TimeZone } from 'aws-cdk-lib'; import * as rds from 'aws-cdk-lib/aws-rds'; import { Construct } from 'constructs'; import { Cron } from './cron'; export interface Schedule { /** * The start schedule * * @default - no start schedule. The RDS instance or cluster will not be started automatically. */ readonly start?: Cron; /** * The stop schedule * * @default - no stop schedule. The RDS instance or cluster will not be stopped automatically. */ readonly stop?: Cron; /** * The timezone for the cron expression * * @default UTC */ readonly timezone?: TimeZone; } /** * Properties for the RdsScheduler */ export interface RdsSchedulerProps { /** * The RDS cluster to start and stop. * If you specify a cluster, you cannot specify an instance. * * @default - no cluster is specified and you must specify an instance */ readonly cluster?: rds.IDatabaseCluster; /** * The RDS instance to start and stop. * If you specify an instance, you cannot specify a cluster. * * @default - no instance is specified and you must specify a cluster */ readonly instance?: rds.IDatabaseInstance; /** * The schedule for starting and stopping the RDS instance or cluster */ readonly schedule: Schedule[]; } /** * A scheduler for RDS instances or clusters */ export declare class RdsScheduler extends Construct { constructor(scope: Construct, id: string, props: RdsSchedulerProps); }