-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
aws-cdk-lib.aws-autoscaling: Add support for configuring AutoScalingGroup's instance maintenance policy #28042
Comments
Yes we welcome pull requests from the community for this feature. Before that, as CFN has supported it, we can use escape hatches to add property overrides as a workaround. |
I will take this. |
…28092) This PR supports for configuring AutoScalingGroup's instance maintenance policy. - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-instancemaintenancepolicy.html - https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-maintenance-policy.html - https://docs.aws.amazon.com/autoscaling/ec2/userguide/instance-maintenance-policy-overview-and-considerations.html Closes #28042. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…ws#28092) This PR supports for configuring AutoScalingGroup's instance maintenance policy. - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-instancemaintenancepolicy.html - https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-maintenance-policy.html - https://docs.aws.amazon.com/autoscaling/ec2/userguide/instance-maintenance-policy-overview-and-considerations.html Closes aws#28042. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Yes, the "Launch Before Terminate" policy is equal to a setting with the Min = 100% (and the Max > 100%). So this setting allows the policy to be used in the CDK. |
Describe the feature
AWS EC2 AutoScaling just added a new way to manage the replacement of instances, called the Instance Maintenance Policy (launch announcement). The policy allows you to control the percentage of instances above and below your desired capacity to allow during replacements/updates. And in particular, this policy now allows a "Launch-Before-Terminate" strategy, to perform replacements without impacting ASG healthy capacity.
Use Case
My team wants to use the new "Launch-Before-Terminate" feature to more safely update our ASGs. In particular, we have a few fleets with very few instances. To safely update now, we must overscale our fleets to maintain enough capacity for serving requests. With this new feature, we can keep our fleets descaled, and use the "Launch-Before-Terminate" feature to safely update.
Proposed Solution
Add a new property to the
AutoScaling
construct that allows you to set the instance maintenance policy.Other Information
References for the policy:
[1] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-instancemaintenancepolicy.html
[2] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html
[3] https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-maintenance-policy.html
[4] https://docs.aws.amazon.com/autoscaling/ec2/userguide/set-instance-maintenance-policy-on-group.html
[5] https://aws.amazon.com/blogs/compute/introducing-instance-maintenance-policy-for-amazon-ec2-auto-scaling/
Acknowledgements
CDK version used
v2.109.0
Environment details (OS name and version, etc.)
Amazon Linux 2
The text was updated successfully, but these errors were encountered: