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());
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic TerminateHookAbandonActionReturns the enum constant of this type with the specified name.static TerminateHookAbandonAction[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
RETAIN
Move instances to a Retained state when termination hook is abandoned. -
TERMINATE
Terminate instances normally when termination hook is abandoned (default behavior).
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-