aws-cdk-lib.aws_autoscaling.MetricTargetTrackingProps

interface MetricTargetTrackingProps

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

Properties for enabling tracking of an arbitrary metric.

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 metricTargetTrackingProps: autoscaling.MetricTargetTrackingProps = {
  metric: metric,
  targetValue: 123,

  // the properties below are optional
  cooldown: cdk.Duration.minutes(30),
  disableScaleIn: false,
  estimatedInstanceWarmup: cdk.Duration.minutes(30),
};

Properties

NameTypeDescription
metricIMetricMetric to track.
targetValuenumberValue to keep the metric around.
cooldown?DurationPeriod after a scaling completes before another scaling activity can start.
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.

metric

Type: IMetric

Metric to track.

The metric must represent a utilization, so that if it's higher than the target value, your ASG should scale out, and if it's lower it should scale in.


targetValue

Type: number

Value to keep the metric around.


cooldown?

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

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


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.