@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-14T16:25:33.795Z") public enum TerminationPolicy extends java.lang.Enum<TerminationPolicy>
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();
Enum Constant and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
static TerminationPolicy |
valueOf(java.lang.String name)
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.
|
public static final TerminationPolicy ALLOCATION_STRATEGY
public static final TerminationPolicy CLOSEST_TO_NEXT_INSTANCE_HOUR
public static final TerminationPolicy DEFAULT
public static final TerminationPolicy NEWEST_INSTANCE
public static final TerminationPolicy OLDEST_INSTANCE
public static final TerminationPolicy OLDEST_LAUNCH_CONFIGURATION
public static final TerminationPolicy OLDEST_LAUNCH_TEMPLATE
public static TerminationPolicy[] values()
for (TerminationPolicy c : TerminationPolicy.values()) System.out.println(c);
public static TerminationPolicy valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null