aws-cdk-lib.aws_autoscaling.BasicTargetTrackingScalingPolicyProps

interface BasicTargetTrackingScalingPolicyProps

LanguageType name
.NETAmazon.CDK.AWS.AutoScaling.BasicTargetTrackingScalingPolicyProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsautoscaling#BasicTargetTrackingScalingPolicyProps
Javasoftware.amazon.awscdk.services.autoscaling.BasicTargetTrackingScalingPolicyProps
Pythonaws_cdk.aws_autoscaling.BasicTargetTrackingScalingPolicyProps
TypeScript (source)aws-cdk-lib » aws_autoscaling » BasicTargetTrackingScalingPolicyProps

Properties for a Target Tracking policy that include the metric but exclude the target.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_autoscaling as autoscaling } from 'aws-cdk-lib';
import { aws_cloudwatch as cloudwatch } from 'aws-cdk-lib';

declare const metric: cloudwatch.Metric;
const basicTargetTrackingScalingPolicyProps: autoscaling.BasicTargetTrackingScalingPolicyProps = {
  targetValue: 123,

  // the properties below are optional
  cooldown: cdk.Duration.minutes(30),
  customMetric: metric,
  disableScaleIn: false,
  estimatedInstanceWarmup: cdk.Duration.minutes(30),
  predefinedMetric: autoscaling.PredefinedMetric.ASG_AVERAGE_CPU_UTILIZATION,
  resourceLabel: 'resourceLabel',
};

Properties

NameTypeDescription
targetValuenumberThe target value for the metric.
cooldown?DurationPeriod after a scaling completes before another scaling activity can start.
customMetric?IMetricA custom metric for application autoscaling.
disableScaleIn?booleanIndicates whether scale in by the target tracking policy is disabled.
estimatedInstanceWarmup?DurationEstimated time until a newly launched instance can send metrics to CloudWatch.
predefinedMetric?PredefinedMetricA predefined metric for application autoscaling.
resourceLabel?stringThe resource label associated with the predefined metric.

targetValue

Type: number

The target value for the metric.


cooldown?

Type: Duration (optional, default: The default cooldown configured on the AutoScalingGroup.)

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


customMetric?

Type: IMetric (optional, default: No custom metric.)

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.


disableScaleIn?

Type: boolean (optional, default: false)

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.


estimatedInstanceWarmup?

Type: Duration (optional, default: Same as the cooldown.)

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


predefinedMetric?

Type: PredefinedMetric (optional, default: No predefined metric.)

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.


resourceLabel?

Type: string (optional, default: No resource label.)

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>