{"id":26677291,"url":"https://github.com/rbilleci/aws-costcontrol-sagemaker","last_synced_at":"2025-07-16T09:36:40.258Z","repository":{"id":255655255,"uuid":"380197874","full_name":"rbilleci/aws-costcontrol-sagemaker","owner":"rbilleci","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-25T10:42:49.000Z","size":3,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T04:19:47.422Z","etag":null,"topics":["aws","cloudformation","cost-control","sagemaker"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rbilleci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-06-25T10:04:20.000Z","updated_at":"2024-12-12T15:33:24.000Z","dependencies_parsed_at":"2024-09-06T15:27:13.118Z","dependency_job_id":"ceee7e94-1110-453e-8d1a-db4c286ef8d8","html_url":"https://github.com/rbilleci/aws-costcontrol-sagemaker","commit_stats":null,"previous_names":["rbilleci/aws-costcontrol-sagemaker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rbilleci/aws-costcontrol-sagemaker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbilleci%2Faws-costcontrol-sagemaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbilleci%2Faws-costcontrol-sagemaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbilleci%2Faws-costcontrol-sagemaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbilleci%2Faws-costcontrol-sagemaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rbilleci","download_url":"https://codeload.github.com/rbilleci/aws-costcontrol-sagemaker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbilleci%2Faws-costcontrol-sagemaker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265500330,"owners_count":23777463,"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","cloudformation","cost-control","sagemaker"],"created_at":"2025-03-26T04:19:37.442Z","updated_at":"2025-07-16T09:36:40.233Z","avatar_url":"https://github.com/rbilleci.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\nThis AWS CloudFormation template can be used to automatically \nshutdown Amazon SageMaker Notebook instances when they are not in use. This is useful for cost savings.\n\nWith this template, when an Amazon SageMaker Notebook Instance is created or started, the following happens:\n- an AWS Lambda function checks if the notebook instance has a config rule that checks for inactivity\n- if the config rule is **not** applied, the instance is `stopped`, and the config rule is applied to the instance\n- when the notebook instance is started at a future time, the config rule will run. If the notebook instance is not in use\n  for more than one hour, the config rule will stop the notebook instance to save costs\n\nThe template creates the following resources:\n\n1. **An Amazon SageMaker Lifecycle Config Rule** - this rule is applied to all new notebook instances, and performs\n   a shutdown of the instance after one hour of inactivity\n2. **CloudWatch Event Rule** - this event rule triggers when a SageMaker Notebook Instance is created or goes through any state-change.\n   The event rule fires a lambda function.\n3. **Lambda Function** - this function is triggered by the event rule. The function checks the Amazon SageMaker Notebook instance\nto determine if it has the config rule applied. If the config rules is not applied, it shuts it down, and applies the config rule.\n4. **Lambda Function Role** - with permissions to update notebook instances, stop notebook instances, and start notebook instances. \n5. **CloudWatch Permission** - for the event rule to invoke the lambda function.\n\n\nConsiderations when using this template:\n\n1. The AWS CloudFormation template must be deployed to each region you want to apply the config rules to.\n2. The SageMaker Notebook instances must be deployed to a VPC than can access the autostop script at: https://raw.githubusercontent.com/aws-samples/amazon-sagemaker-notebook-instance-lifecycle-config-samples/master/scripts/auto-stop-idle/autostop.py\n3. Normally, when a user creates an Amazon SageMaker instance, the instance goes into an 'InService' state. \n Using this automatic config rule, the notebook instance will be stopped so the config rule can be applied. The user must specifically start the instance after creating it.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbilleci%2Faws-costcontrol-sagemaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frbilleci%2Faws-costcontrol-sagemaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbilleci%2Faws-costcontrol-sagemaker/lists"}