interface InstanceRefreshOptions
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.AutoScaling.InstanceRefreshOptions |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsautoscaling#InstanceRefreshOptions |
Java | software.amazon.awscdk.services.autoscaling.InstanceRefreshOptions |
Python | aws_cdk.aws_autoscaling.InstanceRefreshOptions |
TypeScript (source) | aws-cdk-lib » aws_autoscaling » InstanceRefreshOptions |
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
| Name | Type | Description |
|---|---|---|
| strategy | Instance | The strategy to use for the instance refresh. |
| alarms? | IAlarm[] | The CloudWatch alarms to monitor during the instance refresh. |
| bake | Duration | The amount of time after an instance refresh completes successfully before CloudFormation considers the update successful. |
| checkpoint | Duration | The amount of time to wait after a checkpoint is reached before continuing. |
| checkpoint | number[] | Threshold values for each checkpoint in ascending order. |
| instance | Duration | The amount of time to wait after a new instance enters the InService state before moving on to refresh the next instance. |
| max | number | The maximum percentage of the group that can be in service and healthy, or pending, to support your workload during the instance refresh. |
| min | number | 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. |
| scale | Scale | Specifies the behavior of instances that are protected from scale in during an instance refresh. |
| skip | boolean | Indicates whether skip matching is enabled. |
| standby | Standby | Specifies the behavior of instances in standby during an instance refresh. |
strategy
Type:
Instance
The strategy to use for the instance refresh.
alarms?
Type:
IAlarm[]
(optional, default: no alarms)
The CloudWatch alarms to monitor during the instance refresh.
If any of the alarms goes into ALARM state, the instance refresh fails. You can specify up to 10 alarms.
bakeTime?
Type:
Duration
(optional, default: Duration.seconds(0))
The amount of time after an instance refresh completes successfully before CloudFormation considers the update successful.
checkpointDelay?
Type:
Duration
(optional, default: 3600 seconds (1 hour), applied only when checkpointPercentages is set)
The amount of time to wait after a checkpoint is reached before continuing.
checkpointPercentages?
Type:
number[]
(optional, default: no checkpoints)
Threshold values for each checkpoint in ascending order.
Each number must be unique. To replace all instances in the group, the last number in the array must be 100.
instanceWarmup?
Type:
Duration
(optional, default: the group's DefaultInstanceWarmup if defined; otherwise the group's HealthCheckGracePeriod)
The amount of time to wait after a new instance enters the InService state before moving on to refresh the next instance.
maxHealthyPercentage?
Type:
number
(optional, 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 maximum percentage of the group that can be in service and healthy, or pending, to support your workload during the instance refresh.
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.
minHealthyPercentage?
Type:
number
(optional, 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)
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.
scaleInProtectedInstances?
Type:
Scale
(optional, default: ScaleInProtectedInstances.WAIT)
Specifies the behavior of instances that are protected from scale in during an instance refresh.
skipMatching?
Type:
boolean
(optional, default: true)
Indicates whether skip matching is enabled.
standbyInstances?
Type:
Standby
(optional, default: StandbyInstances.WAIT)
Specifies the behavior of instances in standby during an instance refresh.

.NET
Go
Java
Python
TypeScript (