# TargetTrackingMetricProperty

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

Metric is a property of the [AWS::ApplicationAutoScaling::ScalingPolicy TargetTrackingMetricStat](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetricstat.html) property type.

- Source: Generated at build time
- Type last changed: v2.109.0 · 16 Nov 2023

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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"
};
```

Golang:

```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

- `dimensions`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnScalingPolicy.TargetTrackingMetricDimensionProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_applicationautoscaling.CfnScalingPolicy.TargetTrackingMetricDimensionProperty.html)[] — The dimensions for the metric.

  For the list of available dimensions, see the AWS documentation available from the table in [AWS services that publish CloudWatch metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html) in the *Amazon CloudWatch User Guide* .

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

- `metricName`: string — The name of the metric.

- `namespace`: string — The namespace of the metric.

  For more information, see the table in [AWS services that publish CloudWatch metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html) in the *Amazon CloudWatch User Guide* .
