aws-cdk-lib.aws_autoscaling.CfnScalingPolicy.TargetTrackingConfigurationProperty

interface TargetTrackingConfigurationProperty

LanguageType name
.NETAmazon.CDK.AWS.AutoScaling.CfnScalingPolicy.TargetTrackingConfigurationProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsautoscaling#CfnScalingPolicy_TargetTrackingConfigurationProperty
Javasoftware.amazon.awscdk.services.autoscaling.CfnScalingPolicy.TargetTrackingConfigurationProperty
Pythonaws_cdk.aws_autoscaling.CfnScalingPolicy.TargetTrackingConfigurationProperty
TypeScript aws-cdk-lib » aws_autoscaling » CfnScalingPolicy » TargetTrackingConfigurationProperty

TargetTrackingConfiguration is a property of the AWS::AutoScaling::ScalingPolicy resource that specifies a target tracking scaling policy configuration for Amazon EC2 Auto Scaling.

For more information about scaling policies, see Dynamic scaling in the Amazon EC2 Auto Scaling User Guide .

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_autoscaling as autoscaling } from 'aws-cdk-lib';
const targetTrackingConfigurationProperty: autoscaling.CfnScalingPolicy.TargetTrackingConfigurationProperty = {
  targetValue: 123,

  // the properties below are optional
  customizedMetricSpecification: {
    metricName: 'metricName',
    namespace: 'namespace',
    statistic: 'statistic',

    // the properties below are optional
    dimensions: [{
      name: 'name',
      value: 'value',
    }],
    unit: 'unit',
  },
  disableScaleIn: false,
  predefinedMetricSpecification: {
    predefinedMetricType: 'predefinedMetricType',

    // the properties below are optional
    resourceLabel: 'resourceLabel',
  },
};

Properties

NameTypeDescription
targetValuenumberThe target value for the metric.
customizedMetricSpecification?IResolvable | CustomizedMetricSpecificationPropertyA customized metric.
disableScaleIn?boolean | IResolvableIndicates whether scaling in by the target tracking scaling policy is disabled.
predefinedMetricSpecification?IResolvable | PredefinedMetricSpecificationPropertyA predefined metric.

targetValue

Type: number

The target value for the metric.

Some metrics are based on a count instead of a percentage, such as the request count for an Application Load Balancer or the number of messages in an SQS queue. If the scaling policy specifies one of these metrics, specify the target utilization as the optimal average request or message count per instance during any one-minute interval.


customizedMetricSpecification?

Type: IResolvable | CustomizedMetricSpecificationProperty (optional)

A customized metric.

You must specify either a predefined metric or a customized metric.


disableScaleIn?

Type: boolean | IResolvable (optional)

Indicates whether scaling in by the target tracking scaling policy is disabled.

If scaling in is disabled, the target tracking scaling policy doesn't remove instances from the Auto Scaling group. Otherwise, the target tracking scaling policy can remove instances from the Auto Scaling group. The default is false .


predefinedMetricSpecification?

Type: IResolvable | PredefinedMetricSpecificationProperty (optional)

A predefined metric.

You must specify either a predefined metric or a customized metric.