JSPM

@oatelaus/rds-database-scheduler

0.0.10
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15
  • Score
    100M100P100Q20858F
  • License Apache-2.0

Package Exports

  • @oatelaus/rds-database-scheduler
  • @oatelaus/rds-database-scheduler/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@oatelaus/rds-database-scheduler) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

rds-database-scheduler

A CDK Construct that scaffolds a basic scheduling concepts that bring your database up and down based on cron scheduling.

Common usecases of this tool would be keeping your development databases down out of hours or even for longer than 7 days.

Something to note when using this is that database instances can take some time to go up and you should accomodate for this when setting up schedules.

The webhook property provides a way to get updates about your database instances as they become available.

Webhook Body

{
  message: 'Thing happened';
}

Examples

Keep your development database up between 8:45AM and 7:15PM.

new RdsDatabaseScheduler(this, 'database-scheduler', {
  clusterIdentifier: `db-oatelaus`,
  cronSchedules: [
    {
      id: 'daily-enable',
      type: RDSCronType.enable,
      schedule: {
        minute: '45',
        hour: '8',
        weekDay: '*',
        month: '*',
        year: '*',
      },
    },
    {
      id: 'daily-terminate',
      type: RDSCronType.terminate,
      schedule: {
        minute: '15',
        hour: '19',
        weekDay: '*',
        month: '*',
        year: '*',
      },
    },
  ],
});

Bringing your database up for maintenance hours (4:30/5AM -> 6/6:30AM)

new RdsDatabaseScheduler(this, 'database-scheduler', {
  clusterIdentifier: `db-oatelaus`,
  cronSchedules: [
    {
      id: 'maintenance-enable',
      type: RDSCronType.enable,
      schedule: {
        minute: '30',
        hour: '4',
        month: '*',
        year: '*',
        weekDay: 'SUN',
      },
    },
    {
      id: 'maintance-terminate',
      type: RDSCronType.terminate,
      schedule: {
        minute: '30',
        hour: '6',
        month: '*',
        year: '*',
        weekDay: 'SUN',
      },
  ]
});