AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

TargetTrackingScalingPolicy

Import

import { TargetTrackingScalingPolicy } from 'aws-cdk-lib/aws-applicationautoscaling';

Or use the module namespace:

import * as applicationautoscaling from 'aws-cdk-lib/aws-applicationautoscaling';
// applicationautoscaling.TargetTrackingScalingPolicy

Properties

Configuration passed to the constructor as TargetTrackingScalingPolicyProps.

scalingTargetRequired
IScalableTargetRef
4 properties inherited from BasicTargetTrackingScalingPolicyProps
targetValueRequiredinherited from BasicTargetTrackingScalingPolicyProps
number

The target value for the metric.

customMetricOptionalinherited from BasicTargetTrackingScalingPolicyProps
IMetric

A custom metric for application autoscaling. The metric must track utilization. Scaling out will happen if the metric is higher than the target value, scaling in will happen in the metric is lower than the target value. Exactly one of customMetric or predefinedMetric must be specified.

Default: - No custom metric.

predefinedMetricOptionalinherited from BasicTargetTrackingScalingPolicyProps
PredefinedMetric

A predefined metric for application autoscaling. The metric must track utilization. Scaling out will happen if the metric is higher than the target value, scaling in will happen in the metric is lower than the target value. Exactly one of customMetric or predefinedMetric must be specified.

Default: - No predefined metrics.

resourceLabelOptionalinherited from BasicTargetTrackingScalingPolicyProps
string

Identify the resource associated with the metric type. Only used for predefined metric ALBRequestCountPerTarget. Example value: `app/<load-balancer-name>/<load-balancer-id>/targetgroup/<target-group-name>/<target-group-id>`

Default: - No resource label.

4 properties inherited from BaseTargetTrackingProps
disableScaleInOptionalinherited from BaseTargetTrackingProps
boolean

Indicates whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource.

Default: false

policyNameOptionalinherited from BaseTargetTrackingProps
string

A name for the scaling policy.

Default: - Automatically generated name.

scaleInCooldownOptionalinherited from BaseTargetTrackingProps
Duration

Period after a scale in activity completes before another scale in activity can start.

Default: Duration.seconds(300) for the following scalable targets: ECS services, Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, Amazon SageMaker endpoint variants, Custom resources. For all other scalable targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB global secondary indexes, Amazon Comprehend document classification endpoints, Lambda provisioned concurrency

scaleOutCooldownOptionalinherited from BaseTargetTrackingProps
Duration

Period after a scale out activity completes before another scale out activity can start.

Default: Duration.seconds(300) for the following scalable targets: ECS services, Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, Amazon SageMaker endpoint variants, Custom resources. For all other scalable targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB global secondary indexes, Amazon Comprehend document classification endpoints, Lambda provisioned concurrency

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter