InstanceRefreshOptions Struct
Options for customizing the instance refresh update policy.
Example
declare const vpc: ec2.Vpc;
declare const instanceType: ec2.InstanceType;
declare const machineImage: ec2.IMachineImage;
declare const alarm: cloudwatch.Alarm;
new autoscaling.AutoScalingGroup(this, 'ASG', {
vpc,
instanceType,
machineImage,
updatePolicy: autoscaling.UpdatePolicy.instanceRefresh({
strategy: autoscaling.InstanceRefreshStrategy.ROLLING,
minHealthyPercentage: 90,
maxHealthyPercentage: 100,
instanceWarmup: Duration.seconds(300),
checkpointPercentages: [50, 100],
checkpointDelay: Duration.minutes(10),
alarms: [alarm],
}),
});
Properties
alarmsoptionalIAlarmRef[]alarmsoptionaltyping.List[IAlarmRef]alarmsoptionalList<IAlarmRef>AlarmsoptionalIAlarmRef[]Alarmsoptional*[]IAlarmRef#Default: no alarms
If any of the alarms goes into ALARM state, the instance refresh fails. You can specify up to 10 alarms.
bakeTimeoptionalDurationbake_timeoptionalDurationbakeTimeoptionalDurationBakeTimeoptionalDurationBakeTimeoptionalDuration= Duration.seconds(0)#checkpointDelayoptionalDurationcheckpoint_delayoptionalDurationcheckpointDelayoptionalDurationCheckpointDelayoptionalDurationCheckpointDelayoptionalDuration#Default: 3600 seconds (1 hour), applied only when checkpointPercentages is set
checkpointPercentagesoptionalnumber[]checkpoint_percentagesoptionaltyping.List[int | float]checkpointPercentagesoptionalList<Number>CheckpointPercentagesoptionaldouble[]CheckpointPercentagesoptional*[]*float64#Default: no checkpoints
Each number must be unique. To replace all instances in the group, the last number in the array must be 100.
instanceWarmupoptionalDurationinstance_warmupoptionalDurationinstanceWarmupoptionalDurationInstanceWarmupoptionalDurationInstanceWarmupoptionalDuration#Default: the group's DefaultInstanceWarmup if defined; otherwise the group's HealthCheckGracePeriod
maxHealthyPercentageoptionalnumbermax_healthy_percentageoptionalint | floatmaxHealthyPercentageoptionalNumberMaxHealthyPercentageoptionaldoubleMaxHealthyPercentageoptional*float64#Default: the value set in the Auto Scaling group's instance maintenance policy, if defined; otherwise 110 when the strategy is Rolling, or 100 when the strategy is ReplaceRootVolume
The difference between maxHealthyPercentage and minHealthyPercentage cannot be greater than 100. A larger range increases the number of instances that can be replaced at the same time.
minHealthyPercentageoptionalnumbermin_healthy_percentageoptionalint | floatminHealthyPercentageoptionalNumberMinHealthyPercentageoptionaldoubleMinHealthyPercentageoptional*float64#Default: the value set in the Auto Scaling group's instance maintenance policy, if defined; otherwise 100 when the strategy is Rolling, or 90 when the strategy is ReplaceRootVolume
scaleInProtectedInstancesoptionalScaleInProtectedInstancesscale_in_protected_instancesoptionalScaleInProtectedInstancesscaleInProtectedInstancesoptionalScaleInProtectedInstancesScaleInProtectedInstancesoptionalScaleInProtectedInstancesScaleInProtectedInstancesoptionalScaleInProtectedInstances= ScaleInProtectedInstances.WAIT#skipMatchingoptionalbooleanskip_matchingoptionalboolskipMatchingoptionalBooleanSkipMatchingoptionalboolSkipMatchingoptional*bool= true#standbyInstancesoptionalStandbyInstancesstandby_instancesoptionalStandbyInstancesstandbyInstancesoptionalStandbyInstancesStandbyInstancesoptionalStandbyInstancesStandbyInstancesoptionalStandbyInstances= StandbyInstances.WAIT#strategyInstanceRefreshStrategystrategyInstanceRefreshStrategystrategyInstanceRefreshStrategyStrategyInstanceRefreshStrategyStrategyInstanceRefreshStrategyrequired#