Skip to main content

Automatic Start and Stop Scheduler for AWS RDS

Project description

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
    },
  ],
});

Project details


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.6.tar.gz (76.9 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.6-py3-none-any.whl (75.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rds_scheduler-1.1.6.tar.gz
Algorithm Hash digest
SHA256 578155797135564b696b69c89db7c180f46350a902855ea24088fb93f4e40d99
MD5 95d5cad7a2975c2f318891a22cc200af
BLAKE2b-256 577f9d309ffdc087c42a0795017ab5586eaceb88fb349dc37a8ea09ea31e05df

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rds_scheduler-1.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a78df0a812a2a6a69b716175e5dc25b9b54ef60b76dc981eef8fd8f51ac5b0c4
MD5 4feac5626d18a1c9d49bddb18296445e
BLAKE2b-256 bc982f6f506f0ea1b501a6cc2c53ea82acebc8af1442f78a8ed7e624b00b0a11

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page