aws-ecs: Add capacity reservation support to ManagedInstancesCapacityProvider
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
In February, ECS added the ability to integrate managed instances capacity providers with EC2 capacity reservations: https://aws.amazon.com/about-aws/whats-new/2026/02/ecs-mi-ec2-capacity-reservations/
However, L2 support for this feature has not yet been added to CDK. I would like to see that support added.
### Use Case
As a software engineer that manages a GPU-based workload in ECS, I'm tired of managing my own ASGs. However, due to ongoing GPU shortages, I must use capacity reservations to be able to consistently provision the hosts I need to service requests. I can only migrate my ECS services from ASG capacity providers to MI capacity providers if I can use my existing capacity reservations.
### Proposed Solution
Add support for RESERVED capacity options to managed instances capacity providers. This support already exists in L1 structures. Thie feature includes adding `"RESERVED"` as an element of the `CapacityOptionType` enum, and adding the `capacityReservations` field to the `ManagedInstancesCapacityProviderProps` interface.
### Other Information
_No response_
### Acknowledgements
- [x] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### AWS CDK Library version (aws-cdk-lib)
2.261.0
### AWS CDK CLI version
2.1132.0 (build c4e4ee9)
### Environment details (OS name and version, etc.)
Amazon Linux 2 5.10.260-264.1053.amzn2int.x86_64
Contributor guide
Research direction
Start by locating the ManagedInstancesCapacityProviderProps interface and CapacityOptionType enum in the TypeScript L2 implementation, then compare them with the existing L1 structures for capacity reservations. Add the RESERVED option and capacityReservations property, and verify the generated provider configuration and relevant tests cover the new support.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100