{"id":13821249,"url":"https://github.com/iann0036/auto-capacity-reservations","last_synced_at":"2025-06-10T08:06:22.335Z","repository":{"id":69948085,"uuid":"236690077","full_name":"iann0036/auto-capacity-reservations","owner":"iann0036","description":"Automatically assigns EC2 capacity reservations based on the number of instances active.","archived":false,"fork":false,"pushed_at":"2020-02-07T11:23:36.000Z","size":16,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T22:57:41.229Z","etag":null,"topics":["aws","capacity-reservations","ec2"],"latest_commit_sha":null,"homepage":"","language":"Python","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/iann0036.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}},"created_at":"2020-01-28T08:33:54.000Z","updated_at":"2022-10-04T08:32:33.000Z","dependencies_parsed_at":"2023-02-25T11:15:46.309Z","dependency_job_id":null,"html_url":"https://github.com/iann0036/auto-capacity-reservations","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iann0036%2Fauto-capacity-reservations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iann0036%2Fauto-capacity-reservations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iann0036%2Fauto-capacity-reservations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iann0036%2Fauto-capacity-reservations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iann0036","download_url":"https://codeload.github.com/iann0036/auto-capacity-reservations/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iann0036%2Fauto-capacity-reservations/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259033822,"owners_count":22795769,"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","capacity-reservations","ec2"],"created_at":"2024-08-04T08:01:18.598Z","updated_at":"2025-06-10T08:06:22.309Z","avatar_url":"https://github.com/iann0036.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Automatic Capacity Reservations\n\nWhen deployed, EC2 instances will automatically be assigned to a [capacity reservation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html) which will be maintained at the number of running instances that are matched.\n\nThe solution uses EventBridge Rules that react to EC2 instance state changes by invoking a Lambda that creates/increments/decrements or cancels capacity reservations based on the number of instances that match. Instances will be tagged with a `AutoCapacityReservationId` tag which indicates the assigned capacity reservation.\n\nThe solution is intended to provide guaranteed capacity for instances that are in a stopped or degraded state. Capacity reservations will be maintained for the entire lifecycle of an EC2 instance until termination. The capacity reservations are deliberately left in an `open` state so degraded instances can be easily replaced.\n\n## Installation\n\n[![Launch Stack](https://cdn.rawgit.com/buildkite/cloudformation-launch-stack-button-svg/master/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=auto-capacity-reservations\u0026templateURL=https://s3.amazonaws.com/ianmckay-us-east-1/auto-capacity-reservations/template.yml)\n\nClick the above link to deploy the stack to your environment. The capacity reservation provider will be effective for all instances launched within the region after the stack is created.\n\nIf you prefer, you can also manually upsert the [template.yml](https://github.com/iann0036/auto-capacity-reservations/blob/master/template.yml) stack from source and compile your own copy of the Lambda source. Please note that if you do this, the Python requirements must be included in the deployment package.\n\n## Instance Platform Support\n\nWith the [recent introduction](https://aws.amazon.com/about-aws/whats-new/2020/02/amazon-ec2-adds-ability-to-easily-query-billing-information-of-amazon-machine-images/) of full platform information in the DescribeImages API method, capacity reservations can now support all platform types out of the box, which are:\n\n* Linux/UNIX\n* Red Hat Enterprise Linux\n* SUSE Linux\n* Windows\n* Windows with SQL Server\n* Windows with SQL Server Enterprise\n* Windows with SQL Server Standard\n* Windows with SQL Server Web\n* Linux with SQL Server Standard\n* Linux with SQL Server Web\n* Linux with SQL Server Enterprise\n\n## Feedback\n\nAll feedback, issues or pull requests are welcomed to be raised in the project. This project is MIT licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiann0036%2Fauto-capacity-reservations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiann0036%2Fauto-capacity-reservations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiann0036%2Fauto-capacity-reservations/lists"}