feat(autoscaling): add support for AutoScalingInstanceRefresh UpdatePolicy#38277
Open
ethanshen18 wants to merge 5 commits into
Open
feat(autoscaling): add support for AutoScalingInstanceRefresh UpdatePolicy#38277ethanshen18 wants to merge 5 commits into
ethanshen18 wants to merge 5 commits into
Conversation
…olicy Add UpdatePolicy.instanceRefresh() so CDK users can configure the AutoScalingInstanceRefresh update policy on an Auto Scaling group. Previously CDK had no support for this policy. Includes the L1 CfnUpdatePolicy field plus cfn-include parsing, the L2 UpdatePolicy.instanceRefresh() factory with strongly-typed enums and options, README documentation, unit tests, and an integration test.
mrmikeface
suggested changes
Jul 9, 2026
mrmikeface
left a comment
There was a problem hiding this comment.
Looks good Ethan! Where do the docs get created? I think we should consider how to make those approachable
Co-authored-by: caojason-stripe <caojason@stripe.com>
Address review feedback: rewrite the UpdatePolicy.instanceRefresh bullet to match the style of the sibling rollingUpdate/replacingUpdate bullets, and remove the now-unused instance-refresh link reference.
…pdate policy Instance refresh does not support the cfn-signal helper script, so `signals` configured on the AutoScalingGroup only gate the initial creation and are not honored during an instance refresh. Emit a synth-time warning when both are configured, and document the caveat on `UpdatePolicy.instanceRefresh()`.
mrmikeface
approved these changes
Jul 10, 2026
mrmikeface
left a comment
There was a problem hiding this comment.
Looks great! Thanks for the linter
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue # (if applicable)
Closes #38276
Reason for this change
Support the newly released
AutoScalingInstanceRefreshupdate policy. This new update policy was released on 2026-07-09: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-instancerefreshDescription of changes
UpdatePolicy.instanceRefresh(options?)toaws-autoscaling, mirroring the existingrollingUpdate()/replacingUpdate()static factories. The newInstanceRefreshOptionsinterface coversstrategy,minHealthyPercentage,maxHealthyPercentage,instanceWarmup,skipMatching,checkpointPercentages,checkpointDelay,bakeTime,alarmNames,scaleInProtectedInstances, andstandbyInstances.InstanceRefreshStrategy,ScaleInProtectedInstances, andStandbyInstances— per the design guidelines.CfnUpdatePolicy.autoScalingInstanceRefreshfield and the matchingcfn-parselogic so existing templates containing this policy round-trip throughcloudformation-include.Describe any new or updated permissions being added
None. This change only configures an existing CloudFormation update policy on the
AWS::AutoScaling::AutoScalingGroupresource; it does not add or modify any IAM permissions.Description of how you validated changes
instanceRefresh()synthesis with defaults, with all options, and with strategy only; plus acfn-includeparse round-trip test for the new policy.integ.asg-instance-refresh-update-policydeployed successfully against a real AWS account; snapshot committed.UpdatePolicy.instanceRefresh(), changed the AMI to trigger the policy, and confirmed viadescribe-instance-refreshesthat the instance refresh ran toSuccessfuland honored the configured preferences (e.g.MinHealthyPercentage,InstanceWarmup), replacing all instances.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license