AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

TargetTrackingScalingPolicy

Import

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

Or use the module namespace:

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

Properties

Configuration passed to the constructor as TargetTrackingScalingPolicyProps.

autoScalingGroupRequired
IAutoScalingGroupRef
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 metric.

resourceLabelOptionalinherited from BasicTargetTrackingScalingPolicyProps
string

The resource label associated with the predefined metric. Should be supplied if the predefined metric is ALBRequestCountPerTarget, and the format should be: app/<load-balancer-name>/<load-balancer-id>/targetgroup/<target-group-name>/<target-group-id>

Default: - No resource label.

3 properties inherited from BaseTargetTrackingProps
cooldownOptionalinherited from BaseTargetTrackingProps
Duration

Period after a scaling completes before another scaling activity can start.

Default: - The default cooldown configured on the AutoScalingGroup.

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 autoscaling group. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the group.

Default: false

estimatedInstanceWarmupOptionalinherited from BaseTargetTrackingProps
Duration

Estimated time until a newly launched instance can send metrics to CloudWatch.

Default: - Same as the cooldown.

Learn AWS the Practical Way

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

Subscribe to Newsletter