Automatic Start and Stop Scheduler for AWS RDS
Project description
CDK RDS Scheduler Construct
A CDK construct for stopping and starting RDS instances or clusters at arbitrary times primarily aimed at reducing billing costs.
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-0.0.3.tar.gz
(74.9 kB
view hashes)
Built Distribution
Close
Hashes for rds_scheduler-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28029ae1e1ea1a598c8d4dc37402e66c73d620ae00ea5261efa5abd689962a3c |
|
MD5 | 1c147b6871f401e792770468d2ca540a |
|
BLAKE2b-256 | 7b10867466ddb76e68ec6fbd4c5870d1819dee21b20a564b9592bcd60d4c0ee3 |