Skip to main content

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: '?', weekDay: '*' }),
      // timeZone is optional, default is UTC
    },
  ],
});

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rds_scheduler-1.1.8.tar.gz (77.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rds_scheduler-1.1.8-py3-none-any.whl (75.2 kB view details)

Uploaded Python 3

File details

Details for the file rds_scheduler-1.1.8.tar.gz.

File metadata

  • Download URL: rds_scheduler-1.1.8.tar.gz
  • Upload date:
  • Size: 77.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.14.7

File hashes

Hashes for rds_scheduler-1.1.8.tar.gz
Algorithm Hash digest
SHA256 925ca7fc94822b0af653cc54e260bb2aeb67853b6775a6c9dbec5a7eaa7ca596
MD5 2c119a56d5a48d83980aaa1524dc281d
BLAKE2b-256 b50cb5e254f33d8383fac870e1a065a1bdb1870621f094fa54ad84a8670553bd

See more details on using hashes here.

File details

Details for the file rds_scheduler-1.1.8-py3-none-any.whl.

File metadata

  • Download URL: rds_scheduler-1.1.8-py3-none-any.whl
  • Upload date:
  • Size: 75.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.14.7

File hashes

Hashes for rds_scheduler-1.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 16e659c746c3df39e9f89dc7619cc8d7fce63e27f087710521b2d3b061005bf1
MD5 030796fa9c3f9b2879a7957e6d2f7d35
BLAKE2b-256 e5bba8b70b16ea2ac346852ef3ed664bb5074b92a50a798e6d47647babf7ecf4

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.1.8 This release

2 files

1.1.7

2 files

1.1.6

2 files

1.1.5

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.11

2 files

1.0.10

2 files

1.0.9

2 files

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page