{"id":23762349,"url":"https://github.com/appvia/rds-scheduler","last_synced_at":"2025-06-12T20:33:09.679Z","repository":{"id":37959626,"uuid":"164000293","full_name":"appvia/rds-scheduler","owner":"appvia","description":"Manage uptime schedules for RDS Instances and shutdown instances outside of working hours","archived":false,"fork":false,"pushed_at":"2024-09-03T21:36:25.000Z","size":35,"stargazers_count":8,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-12T20:32:09.812Z","etag":null,"topics":["aws","downscale","rds"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appvia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-01-03T16:59:42.000Z","updated_at":"2024-02-15T10:18:40.000Z","dependencies_parsed_at":"2025-06-12T20:32:12.203Z","dependency_job_id":null,"html_url":"https://github.com/appvia/rds-scheduler","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/appvia/rds-scheduler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appvia%2Frds-scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appvia%2Frds-scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appvia%2Frds-scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appvia%2Frds-scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appvia","download_url":"https://codeload.github.com/appvia/rds-scheduler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appvia%2Frds-scheduler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259522450,"owners_count":22870469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","downscale","rds"],"created_at":"2024-12-31T21:18:53.585Z","updated_at":"2025-06-12T20:33:09.560Z","avatar_url":"https://github.com/appvia.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RDS Scheduler\n\n![Build_Status](https://github.com/appvia/rds-scheduler/actions/workflows/publish.yaml/badge.svg) [![Docker Repository on Quay](https://quay.io/repository/appvia/rds-scheduler/status \"Docker Repository on Quay\")](https://quay.io/repository/appvia/rds-scheduler)\n\nManage uptime schedules for RDS Instances and shutdown instances outside of working hours.\n\nAll RDS instances are checked for a given AWS Tag, `appvia.io/rds-scheduler/uptime-schedule`, to determine whether they need to be managed according to a specified uptime schedule. If the AWS Tag is not found, no action is taken on that DB instance.\n\nThe value of an AWS Tag should hold a time definition matching the pattern: `\u003cWEEKDAY-FROM\u003e-\u003cWEEKDAY-TO\u003e \u003cHH:MM-FROM\u003e-\u003cHH:MM-TO\u003e \u003cTIMEZONE\u003e` with the week definition running from Monday =\u003e Sunday.\n\nExample use:\n```yml\n# Keep RDS online from Monday 08:30 until Friday 18:00, and shutdown at all other times\nappvia.io/rds-scheduler/uptime-schedule: MON-FRI 08:30-18:00 Europe/London\n```\n\nOR alternatively:\n```yml\n# Shutdown RDS from Friday 18:00 through to Sunday 20:00\nappvia.io/rds-scheduler/downtime-schedule: FRI-SUN 18:00-20:00 Europe/London\n```\n\n## Usage\n\nSet the Tag `appvia.io/rds-scheduler/uptime-schedule` (or `appvia.io/rds-scheduler/downtime-schedule`) on each RDS instance, providing a time definition as described above.\n\nRun the docker container, providing AWS Credentials either as environment variables or mounting in your AWS config directory, e.g.:\n\n```bash\n# Pass as environment variables\ndocker run --rm -t -e AWS_ACCESS_KEY_ID=X AWS_SECRET_ACCESS_KEY=X -e AWS_REGION=eu-west-2 quay.io/appvia/rds-scheduler\n\n# Use AWS config and profile\ndocker run --rm -t -v ~/.aws:/home/app/.aws:ro -e AWS_PROFILE=my-aws-profile quay.io/appvia/rds-scheduler\n```\n\n### Configuration\n\nThe following environment variables can be passed:\n- `DRY_RUN`: Don't make any changes to RDS instances, just prints what actions would be performed to stdout (default: `false`)\n- `LOOP_INTERVAL_SECS`: How frequently (in seconds) to loop and perform checks on the RDS instance schedules (default: `60`)\n- `RUN_ONCE`: Loop through RDS instances only once and exit the script (default: `false`)\n- `TAG_UPTIME_SCHEDULE`: AWS Tag name on the RDS instances containing a time definition (default: `appvia.io/rds-scheduler/uptime-schedule`)\n- `TAG_DOWNTIME_SCHEDULE`: AWS Tag name on the RDS instances containing a time definition (default: `appvia.io/rds-scheduler/downtime-schedule`)\n\n### Kubernetes\n\nThe RDS Scheduler can run within your Kubernetes Cluster as a lightweight deployment. Review the [./examples/kube](./examples/kube) directory for example deployment files.\n\n### Lambda\n\nThe RDS Scheduler can be configured to run as a Lambda Function within your AWS Account.\n\nThere are some things to note when attempting to run in Lambda:\n- The file to be executed is at the root of the zipfile being uploaded\n- The dependencies are packaged within the zipfile at `./vendor/bundle/ruby/2.5.0/...` (AWS Lambda uses Ruby v2.5.0)\n\nIf you're using **[rbenv](https://github.com/rbenv/rbenv)**:\n```bash\n# Install Ruby v2.5.0\nrbenv install 2.5.0\n\n# Install / Update bundler\ngem install bundler\n\n# Download dependencies\nbundle install --path=lib/vendor/bundle --deployment --without test\n\n# Copy Gemfiles to the lib directory\ncp Gemfile* lib/\n```\n\nExample deployment files are located in the [./examples/terraform](./examples/terraform) directory. The Lambda Function is configured to trigger via a CloudWatch Event Rule and execute every 5 minutes.\n\nAll log output of the Lambda Function is recorded under a CloudWatch Log Group, keeping the same name as the Function (`rds-scheduler`). This is accessible under the following URL (replace with the relevant AWS region): `https://eu-west-2.console.aws.amazon.com/cloudwatch/home?region=eu-west-2#logStream:group=/aws/lambda/rds-scheduler`\n\n## IAM Permissions\n\nFor the RDS Scheduler to function properly, the following IAM Statement is required:\n```json\n{\n    \"Effect\": \"Allow\",\n    \"Action\": [\n        \"rds:DescribeDBInstances\",\n        \"rds:ListTagsForResource\",\n        \"rds:StartDBInstance\",\n        \"rds:StopDBInstance\"\n    ],\n    \"Resource\": \"*\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappvia%2Frds-scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappvia%2Frds-scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappvia%2Frds-scheduler/lists"}