1 | import * as autoscaling from '@aws-cdk/aws-autoscaling';
|
2 | import * as kms from '@aws-cdk/aws-kms';
|
3 | import * as cdk from '@aws-cdk/core';
|
4 | import { Construct } from 'constructs';
|
5 | import { ICluster } from '../cluster';
|
6 | import { Construct as CoreConstruct } from '@aws-cdk/core';
|
7 | /**
|
8 | * Properties for instance draining hook
|
9 | */
|
10 | export interface InstanceDrainHookProps {
|
11 | /**
|
12 | * The AutoScalingGroup to install the instance draining hook for
|
13 | */
|
14 | autoScalingGroup: autoscaling.IAutoScalingGroup;
|
15 | /**
|
16 | * The cluster on which tasks have been scheduled
|
17 | */
|
18 | cluster: ICluster;
|
19 | /**
|
20 | * How many seconds to give tasks to drain before the instance is terminated anyway
|
21 | *
|
22 | * Must be between 0 and 15 minutes.
|
23 | *
|
24 | * @default Duration.minutes(15)
|
25 | */
|
26 | drainTime?: cdk.Duration;
|
27 | /**
|
28 | * The InstanceDrainHook creates an SNS topic for the lifecycle hook of the ASG. If provided, then this
|
29 | * key will be used to encrypt the contents of that SNS Topic.
|
30 | * See [SNS Data Encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-data-encryption.html) for more information.
|
31 | *
|
32 | * @default The SNS Topic will not be encrypted.
|
33 | */
|
34 | topicEncryptionKey?: kms.IKey;
|
35 | }
|
36 | /**
|
37 | * A hook to drain instances from ECS traffic before they're terminated
|
38 | */
|
39 | export declare class InstanceDrainHook extends CoreConstruct {
|
40 | /**
|
41 | * Constructs a new instance of the InstanceDrainHook class.
|
42 | */
|
43 | constructor(scope: Construct, id: string, props: InstanceDrainHookProps);
|
44 | }
|