@@ -21,6 +21,7 @@ import { BasicLifecycleHookProps, LifecycleHook } from './lifecycle-hook';
21
21
import { BasicScheduledActionProps , ScheduledAction } from './scheduled-action' ;
22
22
import { BasicStepScalingPolicyProps , StepScalingPolicy } from './step-scaling-policy' ;
23
23
import { BaseTargetTrackingProps , PredefinedMetric , TargetTrackingScalingPolicy } from './target-tracking-scaling-policy' ;
24
+ import { TerminationPolicy } from './termination-policy' ;
24
25
import { BlockDevice , BlockDeviceVolume , EbsDeviceVolumeType } from './volume' ;
25
26
26
27
/**
@@ -314,6 +315,16 @@ export interface CommonAutoScalingGroupProps {
314
315
* @default - Auto generated by CloudFormation
315
316
*/
316
317
readonly autoScalingGroupName ?: string ;
318
+
319
+ /**
320
+ * A policy or a list of policies that are used to select the instances to
321
+ * terminate. The policies are executed in the order that you list them.
322
+ *
323
+ * @see https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html
324
+ *
325
+ * @default - `TerminationPolicy.DEFAULT`
326
+ */
327
+ readonly terminationPolicies ?: TerminationPolicy [ ] ;
317
328
}
318
329
319
330
/**
@@ -1052,6 +1063,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements
1052
1063
healthCheckGracePeriod : props . healthCheck && props . healthCheck . gracePeriod && props . healthCheck . gracePeriod . toSeconds ( ) ,
1053
1064
maxInstanceLifetime : this . maxInstanceLifetime ? this . maxInstanceLifetime . toSeconds ( ) : undefined ,
1054
1065
newInstancesProtectedFromScaleIn : Lazy . any ( { produce : ( ) => this . newInstancesProtectedFromScaleIn } ) ,
1066
+ terminationPolicies : props . terminationPolicies ,
1055
1067
} ;
1056
1068
1057
1069
if ( ! hasPublic && props . associatePublicIpAddress ) {
0 commit comments