JSPM

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

Automatic Start and Stop Scheduler for AWS RDS

Package Exports

  • cdk-rds-scheduler
  • cdk-rds-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 (cdk-rds-scheduler) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

CDK RDS Scheduler Construct

View on Construct Hub

This is a CDK construct for creating a schedule to periodically start and stop RDS (Aurora) clusters or instances. It can be used to reduce billing outside of operational hours.

Architecture

Open in Visual Studio Code npm version Build Status Release Status License npm downloads

Usage

Install it via npm:

npm install cdk-rds-scheduler

Then use it in your CDK stack:

import { RdsScheduler, Cron } from 'cdk-rds-scheduler';
import { TimeZone } from 'aws-cdk-lib/core';

// for DatabaseCluster
declare const databaseCluster: rds.DatabaseCluster;

new RdsScheduler(this, 'RdsClusterScheduler', {
  cluster: databaseCluster,
  schedule: [
    // Operate only during daytime on weekdays
    {
      start: new Cron({ minute: '0', hour: '8', day: '?', weekDay: 'MON-FRI' }),
      stop: new Cron({ minute: '0', hour: '18', day: '?', weekDay: 'MON-FRI' }),
      timeZone: TimeZone.ASIA_TOKYO,
    },
  ],
});

// for DatabaseInstance
declare const databaseInstance: rds.DatabaseInstance;

new RdsScheduler(this, 'RdsInstanceScheduler', {
  instance: databaseInstance,
  schedule: [
    // Put the instance into a dormant state.
    // As a measure for automatic start of Aurora, stop it every day.
    {
      stop: new Cron({ minute: '0', hour: '0', day: '?' }),
      // timeZone is optional, default is UTC
    },
  ],
});