Skip to main content

AWS RDS Database Running Scheduler

Project description

AWS RDS Database Running Schedule

GitHub npm (scoped) PyPI Nuget GitHub Workflow Status (branch) GitHub release (latest SemVer)

This AWS CDK Construct Stack controls the starting and stopping of RDS DB instances and clusters based on specified tags, ensuring they only run during working hours. It uses EventBridge Scheduler to trigger a StepFunctions State Machine at the start and end of the working hours(default 07:50(UTC) - 21:10(UTC)), which then starts or stops the databases depending on the mode.

Fixed

  • RDS Aurora Cluster
  • RDS Instance

Resources

This construct creating resource list.

  • EventBridge Scheduler execution role
  • EventBridge Scheduler
  • StepFunctions StateMahcine (star or stop controle)
  • StepFunctions StateMahcine execution role

Install

TypeScript

install by npm

npm install @gammarers/aws-rds-database-running-schedule-stack

install by yarn

yarn add @gammarers/aws-rds-database-running-schedule-stack

install by pnpm

pnpm add @gammarers/aws-rds-database-running-schedule-stack

install by bun

bun add @gammarers/aws-rds-database-running-schedule-stack

Python

pip install gammarers.aws-rds-database-running-schedule-stack

C# / .NET

dotnet add package Gammarers.CDK.AWS.RdsDatabaseRunningScheduleStack

Example

import { RdsDatabaseRunningScheduler, DatabaseType } from '@gammarer/aws-rds-database-running-schedule-stack';

new RdsDatabaseRunningScheduleStack(stack, 'RdsDatabaseRunningScheduleStack', {
  targetResource: {
    tagKey: 'WorkHoursRunning', // already tagging to rds instance or cluster
    tagValues: ['YES'], // already tagging to rds instance or cluster
  },
  enableScheduling: true,
  startSchedule: {
    timezone: 'Asia/Tokyo',
    minute: '55',
    hour: '8',
    week: 'MON-FRI',
  },
  stopSchedule: {
    timezone: 'Asia/Tokyo',
    minute: '5',
    hour: '19',
    week: 'MON-FRI',
  },
});

License

This project is licensed under the Apache-2.0 License.

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

Built Distribution

File details

Details for the file gammarers_aws_rds_database_running_schedule_stack-2.0.0.tar.gz.

File metadata

File hashes

Hashes for gammarers_aws_rds_database_running_schedule_stack-2.0.0.tar.gz
Algorithm Hash digest
SHA256 af90700bcda2f7de6898d48875f51bb427899821e4c8550e8f229479b470c959
MD5 ee49489563ec456f89e099180da81d8b
BLAKE2b-256 81ae04d2ee3fd4cf234c8085efaa2514649233351c586e493c1e442a32419843

See more details on using hashes here.

File details

Details for the file gammarers.aws_rds_database_running_schedule_stack-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gammarers.aws_rds_database_running_schedule_stack-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57f20e4f858d0e53d799025a3858bc55ba9726ac9598dea1b6434f6ccf3b8851
MD5 14b1dd8481e208bcd8fef3cef2e08e3e
BLAKE2b-256 3423b56b95195b0da7b36ce3dd54f3f5d3806029e656932685e8c510b90bdc22

See more details on using hashes here.

Supported by

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