Enum TerminationPolicy
- Namespace
- Amazon.CDK.AWS.AutoScaling
- Assembly
- Amazon.CDK.AWS.AutoScaling.dll
Specifies the termination criteria to apply before Amazon EC2 Auto Scaling chooses an instance for termination.
public enum TerminationPolicy
Fields
ALLOCATION_STRATEGY = 0
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 = 1
Terminate instances that are closest to the next billing hour.
DEFAULT = 2
Terminate instances according to the default termination policy.
NEWEST_INSTANCE = 3
Terminate the newest instance in the group.
OLDEST_INSTANCE = 4
Terminate the oldest instance in the group.
OLDEST_LAUNCH_CONFIGURATION = 5
Terminate instances that have the oldest launch configuration.
OLDEST_LAUNCH_TEMPLATE = 6
Terminate instances that have the oldest launch template.
Examples
Vpc vpc;
InstanceType instanceType;
IMachineImage machineImage;
new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = machineImage,
// ...
TerminationPolicies = new [] { TerminationPolicy.OLDEST_INSTANCE, TerminationPolicy.DEFAULT }
});
Remarks
ExampleMetadata: infused