Automatic Start and Stop Scheduler for AWS RDS
Project description
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: '?' }),
// timeZone is optional, default is UTC
},
],
});
Project details
Release history Release notifications | RSS feed
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.0.2.tar.gz
(75.0 kB
view hashes)
Built Distribution
Close
Hashes for rds_scheduler-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbe20dfee8e6a2dfe98155b2f66f5edc007e325e1f0cae9a46ad2a5860f6eab7 |
|
MD5 | cc37fc869fae77b06101903dd9c41a9b |
|
BLAKE2b-256 | 061c1c901ad6ebde71054e8df4db1314aaab593e8eefec59c21cb2df8f94dbb0 |