Skip to content
v2.277.0

CfnAutoScalingInstanceRefreshPreferences Struct ​

Preferences for the AutoScalingInstanceRefresh update policy.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const cfnAutoScalingInstanceRefreshPreferences: cdk.CfnAutoScalingInstanceRefreshPreferences = {
  alarmSpecification: {
    alarms: ['alarms'],
  },
  bakeTime: 123,
  checkpointDelay: 123,
  checkpointPercentages: [123],
  instanceWarmup: 123,
  maxHealthyPercentage: 123,
  minHealthyPercentage: 123,
  scaleInProtectedInstances: 'scaleInProtectedInstances',
  skipMatching: false,
  standbyInstances: 'standbyInstances',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk

cfn_auto_scaling_instance_refresh_preferences = cdk.CfnAutoScalingInstanceRefreshPreferences(
    alarm_specification=cdk.CfnAutoScalingInstanceRefreshAlarmSpecification(
        alarms=["alarms"]
    ),
    bake_time=123,
    checkpoint_delay=123,
    checkpoint_percentages=[123],
    instance_warmup=123,
    max_healthy_percentage=123,
    min_healthy_percentage=123,
    scale_in_protected_instances="scaleInProtectedInstances",
    skip_matching=False,
    standby_instances="standbyInstances"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;

CfnAutoScalingInstanceRefreshPreferences cfnAutoScalingInstanceRefreshPreferences = CfnAutoScalingInstanceRefreshPreferences.builder()
        .alarmSpecification(CfnAutoScalingInstanceRefreshAlarmSpecification.builder()
                .alarms(List.of("alarms"))
                .build())
        .bakeTime(123)
        .checkpointDelay(123)
        .checkpointPercentages(List.of(123))
        .instanceWarmup(123)
        .maxHealthyPercentage(123)
        .minHealthyPercentage(123)
        .scaleInProtectedInstances("scaleInProtectedInstances")
        .skipMatching(false)
        .standbyInstances("standbyInstances")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;

var cfnAutoScalingInstanceRefreshPreferences = new CfnAutoScalingInstanceRefreshPreferences {
    AlarmSpecification = new CfnAutoScalingInstanceRefreshAlarmSpecification {
        Alarms = new [] { "alarms" }
    },
    BakeTime = 123,
    CheckpointDelay = 123,
    CheckpointPercentages = new [] { 123 },
    InstanceWarmup = 123,
    MaxHealthyPercentage = 123,
    MinHealthyPercentage = 123,
    ScaleInProtectedInstances = "scaleInProtectedInstances",
    SkipMatching = false,
    StandbyInstances = "standbyInstances"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"

cfnAutoScalingInstanceRefreshPreferences := &CfnAutoScalingInstanceRefreshPreferences{
	AlarmSpecification: &CfnAutoScalingInstanceRefreshAlarmSpecification{
		Alarms: []*string{
			jsii.String("alarms"),
		},
	},
	BakeTime: jsii.Number(123),
	CheckpointDelay: jsii.Number(123),
	CheckpointPercentages: []*f64{
		jsii.Number(123),
	},
	InstanceWarmup: jsii.Number(123),
	MaxHealthyPercentage: jsii.Number(123),
	MinHealthyPercentage: jsii.Number(123),
	ScaleInProtectedInstances: jsii.String("scaleInProtectedInstances"),
	SkipMatching: jsii.Boolean(false),
	StandbyInstances: jsii.String("standbyInstances"),
}

Properties ​

The CloudWatch alarms to monitor during the instance refresh.

If any alarm goes into ALARM state, the instance refresh fails.

bakeTimeoptionalnumberbake_timeoptionalint | floatbakeTimeoptionalNumberBakeTimeoptionaldoubleBakeTimeoptional*float64= 0#
The number of seconds after an instance refresh completes successfully before CloudFormation considers the update successful.
checkpointDelayoptionalnumbercheckpoint_delayoptionalint | floatcheckpointDelayoptionalNumberCheckpointDelayoptionaldoubleCheckpointDelayoptional*float64#
The number of seconds 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 is a percentage of the total number of instances in the group. When the percentage of instances that have been replaced reaches a checkpoint, the refresh waits for the configured checkpoint delay before continuing.

instanceWarmupoptionalnumberinstance_warmupoptionalint | floatinstanceWarmupoptionalNumberInstanceWarmupoptionaldoubleInstanceWarmupoptional*float64#
The number of seconds to wait after a new instance enters the InService state before moving on to replacing 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

Used to control batch size.

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.

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

scaleInProtectedInstancesoptionalstringscale_in_protected_instancesoptionalstrscaleInProtectedInstancesoptionalStringScaleInProtectedInstancesoptionalstringScaleInProtectedInstancesoptional*string= '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.

If true, instances that already match the desired configuration are not replaced.

standbyInstancesoptionalstringstandby_instancesoptionalstrstandbyInstancesoptionalStringStandbyInstancesoptionalstringStandbyInstancesoptional*string= 'Wait'#
Specifies the behavior of instances in standby during an instance refresh.