/ cloudformation-templates / node_modules / @aws-cdk / aws-lambda / lib / scalable-attribute-api.d.ts
scalable-attribute-api.d.ts
 1  import * as appscaling from '@aws-cdk/aws-applicationautoscaling';
 2  import { IConstruct } from '@aws-cdk/core';
 3  /**
 4   * Interface for scalable attributes.
 5   *
 6   * @stability stable
 7   */
 8  export interface IScalableFunctionAttribute extends IConstruct {
 9      /**
10       * Scale out or in to keep utilization at a given level.
11       *
12       * The utilization is tracked by the
13       * LambdaProvisionedConcurrencyUtilization metric, emitted by lambda. See:
14       * https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html#monitoring-metrics-concurrency
15       *
16       * @stability stable
17       */
18      scaleOnUtilization(options: UtilizationScalingOptions): void;
19      /**
20       * Scale out or in based on schedule.
21       *
22       * @stability stable
23       */
24      scaleOnSchedule(id: string, actions: appscaling.ScalingSchedule): void;
25  }
26  /**
27   * Options for enabling Lambda utilization tracking.
28   *
29   * @stability stable
30   */
31  export interface UtilizationScalingOptions extends appscaling.BaseTargetTrackingProps {
32      /**
33       * Utilization target for the attribute.
34       *
35       * For example, .5 indicates that 50 percent of allocated provisioned concurrency is in use.
36       *
37       * @stability stable
38       */
39      readonly utilizationTarget: number;
40  }
41  /**
42   * Properties for enabling Lambda autoscaling.
43   *
44   * @stability stable
45   */
46  export interface AutoScalingOptions {
47      /**
48       * Minimum capacity to scale to.
49       *
50       * @default 1
51       * @stability stable
52       */
53      readonly minCapacity?: number;
54      /**
55       * Maximum capacity to scale to.
56       *
57       * @stability stable
58       */
59      readonly maxCapacity: number;
60  }