Skip to content
v2.278.0

TargetTrackingMetricProperty Struct ​

Represents a specific metric for a target tracking scaling policy for Application Auto Scaling.

Metric is a property of the AWS::ApplicationAutoScaling::ScalingPolicy TargetTrackingMetricStat property type.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_applicationautoscaling as appscaling } from 'aws-cdk-lib';
const targetTrackingMetricProperty: appscaling.CfnScalingPolicy.TargetTrackingMetricProperty = {
  dimensions: [{
    name: 'name',
    value: 'value',
  }],
  metricName: 'metricName',
  namespace: 'namespace',
};
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_applicationautoscaling as appscaling

target_tracking_metric_property = appscaling.CfnScalingPolicy.TargetTrackingMetricProperty(
    dimensions=[appscaling.CfnScalingPolicy.TargetTrackingMetricDimensionProperty(
        name="name",
        value="value"
    )],
    metric_name="metricName",
    namespace="namespace"
)
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.applicationautoscaling.*;

TargetTrackingMetricProperty targetTrackingMetricProperty = TargetTrackingMetricProperty.builder()
        .dimensions(List.of(TargetTrackingMetricDimensionProperty.builder()
                .name("name")
                .value("value")
                .build()))
        .metricName("metricName")
        .namespace("namespace")
        .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.ApplicationAutoScaling;

var targetTrackingMetricProperty = new TargetTrackingMetricProperty {
    Dimensions = new [] { new TargetTrackingMetricDimensionProperty {
        Name = "name",
        Value = "value"
    } },
    MetricName = "metricName",
    Namespace = "namespace"
};
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"

targetTrackingMetricProperty := &TargetTrackingMetricProperty{
	Dimensions: []interface{}{
		&TargetTrackingMetricDimensionProperty{
			Name: jsii.String("name"),
			Value: jsii.String("value"),
		},
	},
	MetricName: jsii.String("metricName"),
	Namespace: jsii.String("namespace"),
}

Properties ​

dimensionsoptionalIResolvable | IResolvable | CfnScalingPolicy.TargetTrackingMetricDimensionProperty[]dimensionsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, TargetTrackingMetricDimensionProperty]]]dimensionsoptionalIResolvableDimensionsoptionalIResolvableDimensionsoptionalinterface{} #
The dimensions for the metric.
notes

For the list of available dimensions, see the AWS documentation available from the table in AWS services that publish CloudWatch metrics in the Amazon CloudWatch User Guide .

Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.

metricNameoptionalstringmetric_nameoptionalstrmetricNameoptionalStringMetricNameoptionalstringMetricNameoptional*string #
The name of the metric.
namespaceoptionalstringnamespaceoptionalstrnamespaceoptionalStringNamespaceoptionalstringNamespaceoptional*string #
The namespace of the metric.

For more information, see the table in AWS services that publish CloudWatch metrics in the Amazon CloudWatch User Guide .