-
Couldn't load subscription status.
- Fork 4.3k
fix(cloudformation-include): parse MinActiveInstancesPercent in AutoScalingRollingUpdate policy #33852
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
fix(cloudformation-include): parse MinActiveInstancesPercent in AutoScalingRollingUpdate policy #33852
Changes from 1 commit
9b81967
8163c96
a5b1c4b
fe35d93
2562871
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "Resources": { | ||
| "ASG": { | ||
| "Type": "AWS::AutoScaling::AutoScalingGroup", | ||
| "Properties": { | ||
| "MinSize": "1", | ||
| "MaxSize": "10", | ||
| "DesiredCapacity": "2" | ||
| }, | ||
| "UpdatePolicy": { | ||
| "AutoScalingRollingUpdate": { | ||
| "MaxBatchSize": 2, | ||
| "MinInstancesInService": 1, | ||
| "MinSuccessfulInstancesPercent": 75, | ||
| "MinActiveInstancesPercent": 50, | ||
| "PauseTime": "PT5M", | ||
| "SuspendProcesses": ["HealthCheck", "ReplaceUnhealthy"], | ||
| "WaitOnResourceSignals": true | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand we are doing this only for We could have it as a separate PR. But just calling this out here. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -187,6 +187,13 @@ export interface CfnAutoScalingRollingUpdate { | |
| */ | ||
| readonly minSuccessfulInstancesPercent?: number; | ||
|
|
||
| /** | ||
| * Specifies the percentage of instances in an Auto Scaling group that must remain in service while AWS CloudFormation | ||
| * updates old instances. You can specify a value from 0 to 100. AWS CloudFormation rounds to the nearest tenth of a percent. | ||
| * For example, if you update five instances with a minimum active percentage of 50, three instances must remain in service. | ||
| */ | ||
| readonly minActiveInstancesPercent?: number; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have some concerns about potential breaking changes: Based on the CFN doc as indicated below,
Currently,
// Example scenario I think we should handle this with feature flag since it will change existing behaviour. Please help to check. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While I don’t believe this will cause an immediate traffic disruption for customers—since it only affects the update behavior—users will only notice the change in the number of active instances during an update operation, not during regular traffic on the auto-scaling group. However, the impact could be on operations where previously 100% of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While I don't anticipate availability issues during rolling updates with this change, I think it will be good to verify the behaviour when enforcing the I feel it is good to compare the current rolling update behavior against the behavior with this property enforced, specifically focusing on the number of If we can verify there's no reduction in the number of available instances during rolling updates compared to current behavior, I'm comfortable proceeding without a feature flag. However, if we cannot conclusively verify the availability impact, it would be better to implement this with a feature flag as a safety measure. Given that rolling update behavior is also influenced by multiple other UpdatePolicy properties working in combination (MinInstancesInService, MaxBatchSize, etc.), it's challenging to predict all possible scenarios. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TL;DR I agree to stay on the safe side and implement a feature flag, because we cannot guarantee the potential drop in availability will not negatively impact existing services. Here is the analysis summary. Current Behavior (Before Fix)Currently, when a customer imports a CloudFormation template with New Behavior (After Fix)After the fix, when a customer imports a CloudFormation template with Potential ImpactAccording to the AWS CloudFormation documentation on UpdatePolicy, the
If a customer had templates with Actions That Trigger Rolling UpdatesThe following actions can trigger a rolling update for an Auto Scaling group:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. UpdateThere is no need for adding a new feature flag, because the property For the sake of clarity, I think it is good to keep the changes which include the explicit handling of this property in the CfnParse code and the tests (unit and integ). |
||
|
|
||
| /** | ||
| * The amount of time that AWS CloudFormation pauses after making a change to a batch of instances to give those instances | ||
| * time to start software applications. For example, you might need to specify PauseTime when scaling up the number of | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I suggest we have a unit test for this parser here. Atleast for this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend we have a integ test for this here with a similar UpdatePolicy json for the EC2 autoscaling resource