UNPKG

3.29 kBTypeScriptView Raw
1import * as appscaling from '@aws-cdk/aws-applicationautoscaling';
2import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
3import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2';
4import { Construct } from 'constructs';
5/**
6 * The properties of a scalable attribute representing task count.
7 */
8export interface ScalableTaskCountProps extends appscaling.BaseScalableAttributeProps {
9}
10/**
11 * The scalable attribute representing task count.
12 */
13export declare class ScalableTaskCount extends appscaling.BaseScalableAttribute {
14 /**
15 * Constructs a new instance of the ScalableTaskCount class.
16 */
17 constructor(scope: Construct, id: string, props: ScalableTaskCountProps);
18 /**
19 * Scales in or out based on a specified scheduled time.
20 */
21 scaleOnSchedule(id: string, props: appscaling.ScalingSchedule): void;
22 /**
23 * Scales in or out based on a specified metric value.
24 */
25 scaleOnMetric(id: string, props: appscaling.BasicStepScalingPolicyProps): void;
26 /**
27 * Scales in or out to achieve a target CPU utilization.
28 */
29 scaleOnCpuUtilization(id: string, props: CpuUtilizationScalingProps): void;
30 /**
31 * Scales in or out to achieve a target memory utilization.
32 */
33 scaleOnMemoryUtilization(id: string, props: MemoryUtilizationScalingProps): void;
34 /**
35 * Scales in or out to achieve a target Application Load Balancer request count per target.
36 */
37 scaleOnRequestCount(id: string, props: RequestCountScalingProps): void;
38 /**
39 * Scales in or out to achieve a target on a custom metric.
40 */
41 scaleToTrackCustomMetric(id: string, props: TrackCustomMetricProps): void;
42}
43/**
44 * The properties for enabling scaling based on CPU utilization.
45 */
46export interface CpuUtilizationScalingProps extends appscaling.BaseTargetTrackingProps {
47 /**
48 * The target value for CPU utilization across all tasks in the service.
49 */
50 readonly targetUtilizationPercent: number;
51}
52/**
53 * The properties for enabling scaling based on memory utilization.
54 */
55export interface MemoryUtilizationScalingProps extends appscaling.BaseTargetTrackingProps {
56 /**
57 * The target value for memory utilization across all tasks in the service.
58 */
59 readonly targetUtilizationPercent: number;
60}
61/**
62 * The properties for enabling scaling based on Application Load Balancer (ALB) request counts.
63 */
64export interface RequestCountScalingProps extends appscaling.BaseTargetTrackingProps {
65 /**
66 * The number of ALB requests per target.
67 */
68 readonly requestsPerTarget: number;
69 /**
70 * The ALB target group name.
71 */
72 readonly targetGroup: elbv2.ApplicationTargetGroup;
73}
74/**
75 * The properties for enabling target tracking scaling based on a custom CloudWatch metric.
76 */
77export interface TrackCustomMetricProps extends appscaling.BaseTargetTrackingProps {
78 /**
79 * The custom CloudWatch metric to track.
80 *
81 * The metric must represent utilization; that is, you will always get the following behavior:
82 *
83 * - metric > targetValue => scale out
84 * - metric < targetValue => scale in
85 */
86 readonly metric: cloudwatch.IMetric;
87 /**
88 * The target value for the custom CloudWatch metric.
89 */
90 readonly targetValue: number;
91}