-
Notifications
You must be signed in to change notification settings - Fork 4.1k
aws_autoscaling: L2 construct for enabling capacity rebalance of autoscaling group #22625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the feature request, you're right we don't support this yet. We won't need to create a brand new L2 construct for this, instead we could just add support for the CloudFormation property which can set capacity rebalancing on your asg. I think we could add this prop here if anyone wants to try contributing
Since we don't yet offer what CloudFormation does, you can use escape hatches to make necessary adjustments. In this case, we can manually set this property through the L2 AutoScalingGroup construct: const asg = new AutoScalingGroup(this, 'ASG', {...});
(asg.node.defaultChild as CfnAutoScalingGroup).addPropertyOverride('CapacityRebalance', true); I am marking this issue as p2, which means that we are unable to work on this immediately. We use +1s to help prioritize our work, and are happy to revaluate this issue based on community feedback. You can reach out to the cdk.dev community on Slack to solicit support for reprioritization. Check out our contributing guide if you're interested in contributing yourself - there's a low chance the team will be able to address this soon but we'd be happy to review a PR 🙂 |
Hello @peterwoodworth thanks for feedback! I have tried today to implement this feature. It worked 👍🏻 Here is my code snippet in Python for all who missed this feature as well: asg.node.default_child.add_property_override(
"CapacityRebalance", "true"
) |
@peterwoodworth looks like this might have been solved. Should this be closed? |
|
Describe the feature
L2 construct for enabling capacity rebalance of the autoscaling group by utilizing fleet with on-demand and spot instances.
In the recent aws-cdk-lib (2.47.0) it is not possible to activate capacity rebalance in the cdk stack. The operation must be performed manually after stack deployment.
Use Case
The goal of Capacity Rebalancing is to keep processing of workload without interruption. When Spot Instances are at an elevated risk of interruption, the Amazon EC2 Spot service notifies Amazon EC2 Auto Scaling with an EC2 instance rebalance recommendation.
By enabled Capacity Rebalancing for the Auto Scaling group, EC2 Auto Scaling attempts to proactively replace the Spot Instances in the group that have received a rebalance recommendation. This provides an opportunity to rebalance the workload to new Spot Instances that aren't at an elevated risk of interruption. The workload can continue to process the work while Amazon EC2 Auto Scaling launches new Spot Instances before your existing instances are interrupted.
Proposed Solution
L2 construct for enabling capacity rebalance could be implemented as a boolean value e.g. in aws_autoscaling.AutoScalingGroup() or in aws_autoscaling.MixedInstancesPolicy()
Other Information
No response
Acknowledgements
CDK version used
2.47.0
Environment details (OS name and version, etc.)
Ubuntu Linux 20.04 LTS
The text was updated successfully, but these errors were encountered: