Enum TerminationPolicy
- All Implemented Interfaces:
Serializable
,Comparable<TerminationPolicy>
,java.lang.constant.Constable
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:45.424Z")
@Stability(Stable)
public enum TerminationPolicy
extends Enum<TerminationPolicy>
Specifies the termination criteria to apply before Amazon EC2 Auto Scaling chooses an instance for termination.
Example:
Vpc vpc; InstanceType instanceType; IMachineImage machineImage; AutoScalingGroup.Builder.create(this, "ASG") .vpc(vpc) .instanceType(instanceType) .machineImage(machineImage) // ... .terminationPolicies(List.of(TerminationPolicy.OLDEST_INSTANCE, TerminationPolicy.DEFAULT)) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionTerminate instances in the Auto Scaling group to align the remaining instances to the allocation strategy for the type of instance that is terminating (either a Spot Instance or an On-Demand Instance).Terminate instances that are closest to the next billing hour.Terminate instances according to the default termination policy.Terminate the newest instance in the group.Terminate the oldest instance in the group.Terminate instances that have the oldest launch configuration.Terminate instances that have the oldest launch template. -
Method Summary
Modifier and TypeMethodDescriptionstatic TerminationPolicy
Returns the enum constant of this type with the specified name.static TerminationPolicy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ALLOCATION_STRATEGY
Terminate instances in the Auto Scaling group to align the remaining instances to the allocation strategy for the type of instance that is terminating (either a Spot Instance or an On-Demand Instance). -
CLOSEST_TO_NEXT_INSTANCE_HOUR
Terminate instances that are closest to the next billing hour. -
DEFAULT
Terminate instances according to the default termination policy. -
NEWEST_INSTANCE
Terminate the newest instance in the group. -
OLDEST_INSTANCE
Terminate the oldest instance in the group. -
OLDEST_LAUNCH_CONFIGURATION
Terminate instances that have the oldest launch configuration. -
OLDEST_LAUNCH_TEMPLATE
Terminate instances that have the oldest launch template.
-
-
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
-