{"id":13679895,"url":"https://github.com/aws-solutions/instance-scheduler-on-aws","last_synced_at":"2026-02-06T23:03:02.845Z","repository":{"id":38417426,"uuid":"108458330","full_name":"aws-solutions/instance-scheduler-on-aws","owner":"aws-solutions","description":"A cross-account and cross-region solution that allows customers to automatically start and stop EC2 and RDS Instances","archived":false,"fork":false,"pushed_at":"2025-04-10T20:12:44.000Z","size":2622,"stargazers_count":580,"open_issues_count":29,"forks_count":288,"subscribers_count":57,"default_branch":"main","last_synced_at":"2025-05-06T14:13:14.737Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://aws.amazon.com/solutions/implementations/instance-scheduler-on-aws/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aws-solutions.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-10-26T19:48:24.000Z","updated_at":"2025-05-06T08:42:13.000Z","dependencies_parsed_at":"2024-02-28T22:25:36.618Z","dependency_job_id":"37536282-5e0e-4c8b-8b42-2fb9f535ff06","html_url":"https://github.com/aws-solutions/instance-scheduler-on-aws","commit_stats":{"total_commits":44,"total_committers":13,"mean_commits":"3.3846153846153846","dds":0.6818181818181819,"last_synced_commit":"4cc145145b8b775325e015cfdb6f1b9599652923"},"previous_names":["aws-solutions/instance-scheduler-on-aws","aws-solutions/aws-instance-scheduler"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-solutions%2Finstance-scheduler-on-aws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-solutions%2Finstance-scheduler-on-aws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-solutions%2Finstance-scheduler-on-aws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-solutions%2Finstance-scheduler-on-aws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aws-solutions","download_url":"https://codeload.github.com/aws-solutions/instance-scheduler-on-aws/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270641,"owners_count":22042858,"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":[],"created_at":"2024-08-02T13:01:10.785Z","updated_at":"2026-02-06T23:03:02.839Z","avatar_url":"https://github.com/aws-solutions.png","language":"Python","funding_links":[],"categories":["Python","Projects using Projen"],"sub_categories":["Official"],"readme":"# Instance Scheduler on AWS\n\nThe Instance Scheduler on AWS solution automates the starting and stopping of Amazon Elastic Compute Cloud (Amazon EC2)\nand Amazon Relational Database Service (Amazon RDS) instances.\n\nThis solution helps reduce operational costs by stopping resources that are not in use and starting them when they are\nneeded. The cost savings can be significant if you leave all of your instances running at full utilization continuously.\n\n## Getting Started\n\nTo understand how to use Instance Scheduler on AWS, please review the [implementation\nguide](https://docs.aws.amazon.com/solutions/latest/instance-scheduler-on-aws/solution-overview.html) on the [solution\nlanding page](https://aws.amazon.com/solutions/implementations/instance-scheduler-on-aws/). To deploy the solution, see\n[Deploying the Solution](#deploying-the-solution).\n\n## Repository Organization\n\n```\n|- .github/                       - GitHub issue and pull request templates\n|- .projen/                       - projen-generated project metadata\n|- deployment/                    - build scripts\n|- projenrc/                      - projen source code\n|- source/                        - project source code\n  |- app/                         - AWS Lambda Function source code\n  |- cli/                         - Instance Scheduler CLI source code\n  |- instance-scheduler/          - CDK source code\n  |- pipeline/                    - automated testing pipeline source code\n```\n\n## Deploying the Solution\n\n### One-Click Deploy From Amazon Web Services\n\n**[Launch in AWS Console](https://console.aws.amazon.com/cloudformation/home#/stacks/new?\u0026templateURL=https://s3.amazonaws.com/solutions-reference/instance-scheduler-on-aws/latest/instance-scheduler-on-aws.template\u0026redirectId=GitHub)**\n\nRefer to the [deployment instructions](https://docs.aws.amazon.com/solutions/latest/instance-scheduler-on-aws/step-1-launch-the-instance-scheduler-hub-stack.html) in our implementation guide\nfor configuration details and step-by-step instructions on deploying Instance Scheduler on AWS using our pre-packaged deployment assets.\n\n### Deploy from source code using CDK\n\nInstance Scheduler can be deployed to your AWS account directly from the source code using AWS Cloud Development Kit\n(CDK).\n\n#### Prerequisites\n\n- cloned repository\n- AWS CLI v2\n- Node.JS 18\n- docker\n\n#### Deploying the hub stack\n\n```\nnpm ci\nnpx cdk bootstrap\nnpx cdk deploy instance-scheduler-on-aws\n```\n\nThis will deploy the solution into your aws account using all default configuration settings. You will then need to\nupdate those settings to their desired values from the CloudFormation console by selecting the deployed template and\nclicking \"Update\" -\u003e \"Use Current Template\".\n\nRefer to the [Implementation\nGuide](https://docs.aws.amazon.com/solutions/latest/instance-scheduler-on-aws/deployment.html#step1) for guidance on\nwhat each of the configuration parameters is for.\n\n#### Deploying Remote Stacks in Other Accounts\n\nTo deploy the remote stack for cross-account scheduling, you will first need to have deployed the primary control stack.\nThen update your aws credentials to match those of the remote account you would like to schedule and deploy the remote\nstack.\n\n```\nnpx cdk bootstrap\nnpx cdk deploy instance-scheduler-on-aws-remote --parameters InstanceSchedulerAccount={account-id} --parameters Namespace={namespace} --parameters UsingAWSOrganizations={useOrgs}\n```\n\nReplace:\n\n- {account-id} with the id of the account that contains the primary control stack.\n- {namespace} with the same unique namespace that was provided to the primary control stack\n- {useOrgs} with the same value set in the primary control stack (Yes/No)\n\nFor example: `InstanceSchedulerAccount=111222333444`\n\n### Deploy from GitHub (AWS Console)\n\nThis method mimics the procedure used by AWS One-Click Deploy allowing you to deploy the solution from the AWS console\nusing assets that you can control and update.\n\n#### Overview\n\nAWS Solutions use two buckets: a bucket for global access to templates, which is accessed via HTTPS, and regional\nbuckets for access to assets within the region, such as Lambda code. You will need:\n\n- One global bucket that is accessed via the https end point. AWS CloudFormation templates are stored here. Ex.\n  \"mybucket\"\n- One regional bucket for each region where you plan to deploy using the name of the global bucket as the root, and\n  suffixed with the region name. Ex. \"mybucket-us-east-1\"\n- Your buckets should be encrypted and disallow public access.\n\n#### You will need:\n\n- cloned repository\n- AWS CLI v2\n- Node.js 18\n- docker\n- Two S3 buckets (minimum): 1 global and 1 for each region where you will deploy.\n\n#### Step 1 - Download from GitHub\n\nClone the repository to a local directory on your linux client. Note: If you intend to modify Instance Scheduler you may\nwish to create your own fork of the GitHub repo and work from that. This allows you to check in any changes you make to\nyour private copy of the solution.\n\n#### Step 2 - Build the solution\n\nFrom the _deployment_ folder in your cloned repo, run build-s3-dist.sh, passing the root name of your bucket(ex.\nmybucket), name of the solution (i.e. instance-scheduler-on-aws) and the version you are building (ex. v1.5.0). We\nrecommend using a similar version based on the version downloaded from GitHub (ex. GitHub: v1.5.0, your build:\nv1.5.0.mybuild).\n\n```\ncd deployment\n./build-s3-dist.sh \u003cbucketname\u003e instance-scheduler-on-aws \u003cversion\u003e\n```\n\n#### Step 3 - Upload to your buckets\n\nThe previous step will have generated several folders in your local directory including:\n\n```\ndeployment/global-s3-assets\ndeployment/regional-s3-assets\n```\n\nUpload the contents of `deployment/global-s3-assets` to your global bucket and `deployment/regional-s3-assets` to your\nregional buckets following the pattern `s3://\u003cbucket-name\u003e/\u003csolution-name\u003e/\u003cversion\u003e/\u003casset\u003e`.\n\nFor example:\n\n```\n//global assets\ns3://mybucket/instance-scheduler-on-aws/v1.5.0/instance-scheduler.template\ns3://mybucket/instance-scheduler-on-aws/v1.5.0/instance-scheduler-remote.template\n\n//regional assets\ns3://mybucket-us-east-1/instance-scheduler-on-aws/v1.5.0/f779f5b7643ba70e9a5e25c8898f4e4e8e54ca15b150eee1dd25c2c636b188b8.zip\ns3://mybucket-us-west-1/instance-scheduler-on-aws/v1.5.0/f779f5b7643ba70e9a5e25c8898f4e4e8e54ca15b150eee1dd25c2c636b188b8.zip\n```\n\n_Note: The scheduler-cli is optional and does not need to be published to the global bucket for deploy to work._\n\n#### Step 4 - Deploy The Solution\n\nRefer to the [Implementation\nGuide](https://docs.aws.amazon.com/solutions/latest/instance-scheduler-on-aws/deployment.html) for deployment\ninstructions, using the link to the instance-scheduler.template from your bucket, rather than the one for AWS Solutions.\nEx. https://mybucket.s3.amazonaws.com/instance-scheduler-on-aws/v1.5.0.mybuild/instance-scheduler.template\n\n## Testing the Solution\n\n### Prerequisites\n\n- cloned repository\n- AWS CLI v2\n- Node.js 18\n- docker\n- Python 3.10\n- tox\n\n### Running Tests Locally\n\n```\nnpm ci\nnpm run test\n```\n\n## Modifying the Solution\n\n### projen\n\nThis solution uses [projen](https://projen.io/) to manage certain project files. If you need to modify any of these\nfiles, modify the source in [.projenrc.ts](./.projenrc.ts) and run `projen` to regenerate the files.\n\n### Package installation\n\n```\n# For Node.js dependencies\nnpm ci\n\n# For Python dependencies\ncd source/app\npoetry install\n```\n\nIf you don't have `poetry`, refer to [Poetry](https://python-poetry.org/docs/) to install `poetry`.\n\n## CDK Documentation\n\nInstance Scheduler on AWS templates are generated using AWS CDK, for further information on CDK please refer to the\n[documentation](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html).\n\n## Collection of Operational Metrics\n\nCollection of operational metrics\n\nThis solution sends operational metrics to AWS (the “Data”) about the use of this solution.\nWe use this Data to better understand how customers use this solution and related services \nand products. AWS’s collection of this Data is subject to the [AWS Privacy Notice](https://aws.amazon.com/privacy/).\n---\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\nLicensed under the Apache License Version 2.0 (the \"License\"). You may not use this file except in compliance with the\nLicense. A copy of the License is located at\n\n    http://www.apache.org/licenses/\n\nor in the \"[LICENSE](./LICENSE)\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing\npermissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws-solutions%2Finstance-scheduler-on-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faws-solutions%2Finstance-scheduler-on-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws-solutions%2Finstance-scheduler-on-aws/lists"}