Skip to content
v2.274.0

TargetTrackingConfigurationProperty Struct ​

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 ​

ts
// 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: {
    dimensions: [{
      name: 'name',
      value: 'value',
    }],
    metricName: 'metricName',
    metrics: [{
      id: 'id',

      // the properties below are optional
      expression: 'expression',
      label: 'label',
      metricStat: {
        metric: {
          metricName: 'metricName',
          namespace: 'namespace',

          // the properties below are optional
          dimensions: [{
            name: 'name',
            value: 'value',
          }],
        },
        stat: 'stat',

        // the properties below are optional
        period: 123,
        unit: 'unit',
      },
      period: 123,
      returnData: false,
    }],
    namespace: 'namespace',
    period: 123,
    statistic: 'statistic',
    unit: 'unit',
  },
  disableScaleIn: false,
  predefinedMetricSpecification: {
    predefinedMetricType: 'predefinedMetricType',

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

Properties ​

customizedMetricSpecificationIResolvable | CfnScalingPolicy.CustomizedMetricSpecificationPropertycustomized_metric_specificationtyping.Union[IResolvable, CustomizedMetricSpecificationProperty]customizedMetricSpecificationIResolvableCustomizedMetricSpecificationIResolvableCustomizedMetricSpecificationinterface{}#
A customized metric.

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

disableScaleInboolean | IResolvabledisable_scale_intyping.Union[bool, IResolvable]disableScaleInBooleanDisableScaleInboolDisableScaleIninterface{}#
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 .

predefinedMetricSpecificationIResolvable | CfnScalingPolicy.PredefinedMetricSpecificationPropertypredefined_metric_specificationtyping.Union[IResolvable, PredefinedMetricSpecificationProperty]predefinedMetricSpecificationIResolvablePredefinedMetricSpecificationIResolvablePredefinedMetricSpecificationinterface{}#
A predefined metric.

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

targetValuenumbertarget_valueint | floattargetValueNumberTargetValuedoubleTargetValue*float64required#
The target value for the metric.
notes

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.