Skip to content
v2.278.0

TargetTrackingConfigurationProperty Struct ​

TargetTrackingConfiguration is a subproperty of ScalingInstruction that specifies a target tracking configuration for a scalable resource.

Example ​

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

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

    // the properties below are optional
    dimensions: [{
      name: 'name',
      value: 'value',
    }],
    unit: 'unit',
  },
  disableScaleIn: false,
  estimatedInstanceWarmup: 123,
  predefinedScalingMetricSpecification: {
    predefinedScalingMetricType: 'predefinedScalingMetricType',

    // the properties below are optional
    resourceLabel: 'resourceLabel',
  },
  scaleInCooldown: 123,
  scaleOutCooldown: 123,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_autoscalingplans as autoscalingplans

target_tracking_configuration_property = autoscalingplans.CfnScalingPlan.TargetTrackingConfigurationProperty(
    target_value=123,

    # the properties below are optional
    customized_scaling_metric_specification=autoscalingplans.CfnScalingPlan.CustomizedScalingMetricSpecificationProperty(
        metric_name="metricName",
        namespace="namespace",
        statistic="statistic",

        # the properties below are optional
        dimensions=[autoscalingplans.CfnScalingPlan.MetricDimensionProperty(
            name="name",
            value="value"
        )],
        unit="unit"
    ),
    disable_scale_in=False,
    estimated_instance_warmup=123,
    predefined_scaling_metric_specification=autoscalingplans.CfnScalingPlan.PredefinedScalingMetricSpecificationProperty(
        predefined_scaling_metric_type="predefinedScalingMetricType",

        # the properties below are optional
        resource_label="resourceLabel"
    ),
    scale_in_cooldown=123,
    scale_out_cooldown=123
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.autoscalingplans.*;

TargetTrackingConfigurationProperty targetTrackingConfigurationProperty = TargetTrackingConfigurationProperty.builder()
        .targetValue(123)

        // the properties below are optional
        .customizedScalingMetricSpecification(CustomizedScalingMetricSpecificationProperty.builder()
                .metricName("metricName")
                .namespace("namespace")
                .statistic("statistic")

                // the properties below are optional
                .dimensions(List.of(MetricDimensionProperty.builder()
                        .name("name")
                        .value("value")
                        .build()))
                .unit("unit")
                .build())
        .disableScaleIn(false)
        .estimatedInstanceWarmup(123)
        .predefinedScalingMetricSpecification(PredefinedScalingMetricSpecificationProperty.builder()
                .predefinedScalingMetricType("predefinedScalingMetricType")

                // the properties below are optional
                .resourceLabel("resourceLabel")
                .build())
        .scaleInCooldown(123)
        .scaleOutCooldown(123)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AutoScalingPlans;

var targetTrackingConfigurationProperty = new TargetTrackingConfigurationProperty {
    TargetValue = 123,

    // the properties below are optional
    CustomizedScalingMetricSpecification = new CustomizedScalingMetricSpecificationProperty {
        MetricName = "metricName",
        Namespace = "namespace",
        Statistic = "statistic",

        // the properties below are optional
        Dimensions = new [] { new MetricDimensionProperty {
            Name = "name",
            Value = "value"
        } },
        Unit = "unit"
    },
    DisableScaleIn = false,
    EstimatedInstanceWarmup = 123,
    PredefinedScalingMetricSpecification = new PredefinedScalingMetricSpecificationProperty {
        PredefinedScalingMetricType = "predefinedScalingMetricType",

        // the properties below are optional
        ResourceLabel = "resourceLabel"
    },
    ScaleInCooldown = 123,
    ScaleOutCooldown = 123
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

targetTrackingConfigurationProperty := &TargetTrackingConfigurationProperty{
	TargetValue: jsii.Number(123),

	// the properties below are optional
	CustomizedScalingMetricSpecification: &CustomizedScalingMetricSpecificationProperty{
		MetricName: jsii.String("metricName"),
		Namespace: jsii.String("namespace"),
		Statistic: jsii.String("statistic"),

		// the properties below are optional
		Dimensions: []interface{}{
			&MetricDimensionProperty{
				Name: jsii.String("name"),
				Value: jsii.String("value"),
			},
		},
		Unit: jsii.String("unit"),
	},
	DisableScaleIn: jsii.Boolean(false),
	EstimatedInstanceWarmup: jsii.Number(123),
	PredefinedScalingMetricSpecification: &PredefinedScalingMetricSpecificationProperty{
		PredefinedScalingMetricType: jsii.String("predefinedScalingMetricType"),

		// the properties below are optional
		ResourceLabel: jsii.String("resourceLabel"),
	},
	ScaleInCooldown: jsii.Number(123),
	ScaleOutCooldown: jsii.Number(123),
}

Properties ​

customizedScalingMetricSpecificationoptionalIResolvable | CfnScalingPlan.CustomizedScalingMetricSpecificationPropertycustomized_scaling_metric_specificationoptionaltyping.Union[IResolvable, CustomizedScalingMetricSpecificationProperty]customizedScalingMetricSpecificationoptionalIResolvableCustomizedScalingMetricSpecificationoptionalIResolvableCustomizedScalingMetricSpecificationoptionalinterface{} #
A customized metric.

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

disableScaleInoptionalboolean | IResolvabledisable_scale_inoptionaltyping.Union[bool, IResolvable]disableScaleInoptionalBooleanDisableScaleInoptionalboolDisableScaleInoptionalinterface{} #
Indicates whether scale in by the target tracking scaling policy is disabled.
notes

If the value is true , scale in is disabled and the target tracking scaling policy doesn't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking scaling policy can remove capacity from the scalable resource.

The default value is false .

estimatedInstanceWarmupoptionalnumberestimated_instance_warmupoptionalint | floatestimatedInstanceWarmupoptionalNumberEstimatedInstanceWarmupoptionaldoubleEstimatedInstanceWarmupoptional*float64 #
The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.

This value is used only if the resource is an Auto Scaling group.

predefinedScalingMetricSpecificationoptionalIResolvable | CfnScalingPlan.PredefinedScalingMetricSpecificationPropertypredefined_scaling_metric_specificationoptionaltyping.Union[IResolvable, PredefinedScalingMetricSpecificationProperty]predefinedScalingMetricSpecificationoptionalIResolvablePredefinedScalingMetricSpecificationoptionalIResolvablePredefinedScalingMetricSpecificationoptionalinterface{} #
A predefined metric.

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

scaleInCooldownoptionalnumberscale_in_cooldownoptionalint | floatscaleInCooldownoptionalNumberScaleInCooldownoptionaldoubleScaleInCooldownoptional*float64 #
The amount of time, in seconds, after a scale-in activity completes before another scale in activity can start.

This value is not used if the scalable resource is an Auto Scaling group.

scaleOutCooldownoptionalnumberscale_out_cooldownoptionalint | floatscaleOutCooldownoptionalNumberScaleOutCooldownoptionaldoubleScaleOutCooldownoptional*float64 #
The amount of time, in seconds, after a scale-out activity completes before another scale-out activity can start.

This value is not used if the scalable resource is an Auto Scaling group.

targetValuenumbertarget_valueint | floattargetValueNumberTargetValuedoubleTargetValue*float64 required #
The target value for the metric.

Although this property accepts numbers of type Double, it won't accept values that are either too small or too large. Values must be in the range of -2^360 to 2^360.