Enum TerminateHookAbandonAction

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

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-03-31T09:54:25.759Z") @Stability(Stable) public enum TerminateHookAbandonAction extends Enum<TerminateHookAbandonAction>
Actions for when a termination lifecycle hook is abandoned.

Example:

 Vpc vpc;
 InstanceType instanceType;
 IMachineImage machineImage;
 AutoScalingGroup asg = AutoScalingGroup.Builder.create(this, "ASG")
         .vpc(vpc)
         .instanceType(instanceType)
         .machineImage(machineImage)
         // Configure instance lifecycle policy
         .instanceLifecyclePolicy(InstanceLifecyclePolicy.builder()
                 .retentionTriggers(RetentionTriggers.builder()
                         .terminateHookAbandon(TerminateHookAbandonAction.RETAIN)
                         .build())
                 .build())
         .build();
 // Add termination lifecycle hook (required for the policy to take effect)
 asg.addLifecycleHook("TerminationHook", BasicLifecycleHookProps.builder()
         .lifecycleTransition(LifecycleTransition.INSTANCE_TERMINATING)
         .build());
 
  • Enum Constant Details

    • RETAIN

      @Stability(Stable) public static final TerminateHookAbandonAction RETAIN
      Move instances to a Retained state when termination hook is abandoned.
    • TERMINATE

      @Stability(Stable) public static final TerminateHookAbandonAction TERMINATE
      Terminate instances normally when termination hook is abandoned (default behavior).
  • Method Details

    • values

      public static TerminateHookAbandonAction[] 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 TerminateHookAbandonAction 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