{"id":21858,"library":"rds-database-running-scheduler","title":"RDS Database Running Scheduler","description":"AWS CDK v2 construct to automatically start and stop RDS instances and Aurora clusters on a schedule using EventBridge Scheduler and a Lambda with durable execution. Current stable version is 0.1.4, released in April 2026 with active development. Key differentiator: tag-based resource targeting, configurable timezone/weekdays, optional Slack notifications via Secrets Manager, and built-in polling for desired state. Requires aws-cdk-lib ^2.232.0 and constructs ^10.5.1.","status":"active","version":"0.1.4","language":"javascript","source_language":"en","source_url":"https://github.com/gammarers-aws-cdk-constructs/rds-database-running-scheduler","tags":["javascript","cdk","typescript"],"install":[{"cmd":"npm install rds-database-running-scheduler","lang":"bash","label":"npm"},{"cmd":"yarn add rds-database-running-scheduler","lang":"bash","label":"yarn"},{"cmd":"pnpm add rds-database-running-scheduler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"AWS CDK core library with RDS, Lambda, EventBridge Scheduler, and IAM modules","package":"aws-cdk-lib","optional":false},{"reason":"CDK constructs base library required for Construct class","package":"constructs","optional":false}],"imports":[{"note":"ESM-only package; no CommonJS support. TypeScript types are bundled.","wrong":"const RDSDatabaseRunningScheduler = require('rds-database-running-scheduler')","symbol":"RDSDatabaseRunningScheduler","correct":"import { RDSDatabaseRunningScheduler } from 'rds-database-running-scheduler'"},{"note":"This is a named export, not a default export.","wrong":"import RDSDatabaseRunningScheduleStack from 'rds-database-running-scheduler'","symbol":"RDSDatabaseRunningScheduleStack","correct":"import { RDSDatabaseRunningScheduleStack } from 'rds-database-running-scheduler'"},{"note":"Type-only import if using TypeScript: import type { TargetResource } from ...","wrong":"import { TargetResourceProps } from 'rds-database-running-scheduler'","symbol":"TargetResource","correct":"import { TargetResource } from 'rds-database-running-scheduler'"}],"quickstart":{"code":"import { App, Stack } from 'aws-cdk-lib';\nimport { RDSDatabaseRunningScheduler } from 'rds-database-running-scheduler';\n\nconst app = new App();\nconst stack = new Stack(app, 'TestStack', { env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION } });\n\nnew RDSDatabaseRunningScheduler(stack, 'RDSRunningScheduler', {\n  targetResource: { tagKey: 'WorkHoursRunning', tagValues: ['YES'] },\n  secrets: { slackSecretName: 'my/slack/webhook' },\n  enableScheduling: true,\n  startSchedule: { timezone: 'UTC', minute: '50', hour: '7', week: 'MON-FRI' },\n  stopSchedule: { timezone: 'UTC', minute: '5', hour: '19', week: 'MON-FRI' },\n});\n\napp.synth();","lang":"typescript","description":"Creates a CDK app with an RDSDatabaseRunningScheduler to start/stop tagged RDS instances on weekdays at 07:50 UTC and 19:05 UTC."},"warnings":[{"fix":"Upgrade to >=0.1.0 and update construct props to match current API.","message":"Version 0.1.0 introduced the initial API with breaking changes from v0.0.0 (first release).","severity":"breaking","affected_versions":"<0.1.0"},{"fix":"Ensure the secret has the correct JSON structure: {\\\"slackToken\\\": \\\"xoxb-...\\\", \\\"slackChannel\\\": \\\"#channel\\\"}","message":"The secrets.slackSecretName must reference a Secrets Manager secret with keys 'slackToken' and 'slackChannel'. Missing these keys will cause Lambda runtime errors.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Check that the Lambda execution role has rds:StartDBInstance, rds:StopDBInstance, rds:StartDBCluster, rds:StopDBCluster permissions.","message":"The construct deploys Lambda functions that require IAM permissions to start/stop RDS instances. If the CDK deployment fails with 'Resource handler returned message: ... is not authorized', the IAM policy may be insufficient.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Run: aws iam create-service-linked-role --aws-service-name scheduler.amazonaws.com","message":"EventBridge Scheduler is used; ensure the AWS account has the service-linked role for scheduler (AWSServiceRoleForAmazonScheduler). CDK may not create it automatically.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'npm install rds-database-running-scheduler' and verify package.json has the correct name.","cause":"Package not installed or typo in package name","error":"Cannot find module 'rds-database-running-scheduler'"},{"fix":"Provide startSchedule and stopSchedule objects with at least timezone, minute, hour, week.","cause":"Missing required props when instantiating the construct","error":"Property 'startSchedule' is missing in type '{}'"},{"fix":"Create a secret with JSON: {\\\"slackToken\\\": \\\"...\\\", \\\"slackChannel\\\": \\\"...\\\"}","cause":"The Slack secret in Secrets Manager does not contain the expected keys","error":"TypeError: Cannot read properties of undefined (reading 'slackToken')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}