Enum InstanceRefreshStrategy

java.lang.Object
java.lang.Enum<InstanceRefreshStrategy>
software.amazon.awscdk.services.autoscaling.InstanceRefreshStrategy
All Implemented Interfaces:
Serializable, Comparable<InstanceRefreshStrategy>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.138.0 (build 0ca7ee8)", date="2026-07-31T10:49:23.690Z") @Stability(Stable) public enum InstanceRefreshStrategy extends Enum<InstanceRefreshStrategy>
The strategy to use for the instance refresh.

Example:

 Vpc vpc;
 InstanceType instanceType;
 IMachineImage machineImage;
 Alarm alarm;
 AutoScalingGroup.Builder.create(this, "ASG")
         .vpc(vpc)
         .instanceType(instanceType)
         .machineImage(machineImage)
         .updatePolicy(UpdatePolicy.instanceRefresh(InstanceRefreshOptions.builder()
                 .strategy(InstanceRefreshStrategy.ROLLING)
                 .minHealthyPercentage(90)
                 .maxHealthyPercentage(100)
                 .instanceWarmup(Duration.seconds(300))
                 .checkpointPercentages(List.of(50, 100))
                 .checkpointDelay(Duration.minutes(10))
                 .alarms(List.of(alarm))
                 .build()))
         .build();
 
  • Enum Constant Details

    • ROLLING

      @Stability(Stable) public static final InstanceRefreshStrategy ROLLING
      Terminate instances and launch new ones to replace them.
    • REPLACE_ROOT_VOLUME

      @Stability(Stable) public static final InstanceRefreshStrategy REPLACE_ROOT_VOLUME
      Replace the root volume of instances in place.

      When this strategy is used, only ImageId changes within the launch template or mixed instances policy are allowed. Other property changes may cause the stack update to fail.

  • Method Details

    • values

      public static InstanceRefreshStrategy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static InstanceRefreshStrategy valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null