CDK RDS Scheduler Construct
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.
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
925ca7fc94822b0af653cc54e260bb2aeb67853b6775a6c9dbec5a7eaa7ca596
|
|
| MD5 |
2c119a56d5a48d83980aaa1524dc281d
|
|
| BLAKE2b-256 |
b50cb5e254f33d8383fac870e1a065a1bdb1870621f094fa54ad84a8670553bd
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16e659c746c3df39e9f89dc7619cc8d7fce63e27f087710521b2d3b061005bf1
|
|
| MD5 |
030796fa9c3f9b2879a7957e6d2f7d35
|
|
| BLAKE2b-256 |
e5bba8b70b16ea2ac346852ef3ed664bb5074b92a50a798e6d47647babf7ecf4
|