aws-cdk-lib.aws_autoscaling.CfnScalingPolicy.MetricProperty

interface MetricProperty

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

Represents a specific metric.

Metric is a property of the AWS::AutoScaling::ScalingPolicy MetricStat property type.

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 metricProperty: autoscaling.CfnScalingPolicy.MetricProperty = {
  metricName: 'metricName',
  namespace: 'namespace',

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

Properties

NameTypeDescription
metricNamestringThe name of the metric.
namespacestringThe namespace of the metric.
dimensions?IResolvable | IResolvable | MetricDimensionProperty[]The dimensions for the metric.

metricName

Type: string

The name of the metric.


namespace

Type: 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 .


dimensions?

Type: IResolvable | IResolvable | MetricDimensionProperty[] (optional)

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 in the Amazon CloudWatch User Guide .

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