Skip to content
v2.275.0

InstanceRefreshOptions Struct ​

Options for customizing the instance refresh update policy.

Example ​

ts
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#
The CloudWatch alarms to monitor during the instance refresh.

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)#
The amount of time after an instance refresh completes successfully before CloudFormation considers the update successful.
checkpointDelayoptionalDurationcheckpoint_delayoptionalDurationcheckpointDelayoptionalDurationCheckpointDelayoptionalDurationCheckpointDelayoptionalDuration#
The amount of time to wait after a checkpoint is reached before continuing.

Default: 3600 seconds (1 hour), applied only when checkpointPercentages is set

checkpointPercentagesoptionalnumber[]checkpoint_percentagesoptionaltyping.List[int | float]checkpointPercentagesoptionalList<Number>CheckpointPercentagesoptionaldouble[]CheckpointPercentagesoptional*[]*float64#
Threshold values for each checkpoint in ascending order.

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#
The amount of time to wait after a new instance enters the InService state before moving on to refresh the next instance.

Default: the group's DefaultInstanceWarmup if defined; otherwise the group's HealthCheckGracePeriod

maxHealthyPercentageoptionalnumbermax_healthy_percentageoptionalint | floatmaxHealthyPercentageoptionalNumberMaxHealthyPercentageoptionaldoubleMaxHealthyPercentageoptional*float64#
The maximum percentage of the group that can be in service and healthy, or pending, to support your workload during the instance refresh.

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#
The minimum percentage of the group to keep in service, healthy, and ready to use to support your workload during the instance refresh, expressed as a percentage of the group's desired capacity.

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#
Specifies the behavior of instances that are protected from scale in during an instance refresh.
skipMatchingoptionalbooleanskip_matchingoptionalboolskipMatchingoptionalBooleanSkipMatchingoptionalboolSkipMatchingoptional*bool= true#
Indicates whether skip matching is enabled.
standbyInstancesoptionalStandbyInstancesstandby_instancesoptionalStandbyInstancesstandbyInstancesoptionalStandbyInstancesStandbyInstancesoptionalStandbyInstancesStandbyInstancesoptionalStandbyInstances= StandbyInstances.WAIT#
Specifies the behavior of instances in standby during an instance refresh.
The strategy to use for the instance refresh.