aws-cdk-lib.aws_autoscaling.CfnScalingPolicy.MetricStatProperty

interface MetricStatProperty

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

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

This structure defines the CloudWatch metric to return, along with the statistic, period, and unit.

For more information about the CloudWatch terminology below, see Amazon CloudWatch concepts in the Amazon CloudWatch User Guide .

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 metricStatProperty: autoscaling.CfnScalingPolicy.MetricStatProperty = {
  metric: {
    metricName: 'metricName',
    namespace: 'namespace',

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

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

Properties

NameTypeDescription
metricIResolvable | MetricPropertyThe CloudWatch metric to return, including the metric name, namespace, and dimensions.
statstringThe statistic to return.
unit?stringThe unit to use for the returned data points.

metric

Type: IResolvable | MetricProperty

The CloudWatch metric to return, including the metric name, namespace, and dimensions.

To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics .


stat

Type: string

The statistic to return.

It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in Statistics in the Amazon CloudWatch User Guide .

The most commonly used metrics for predictive scaling are Average and Sum .


unit?

Type: string (optional)

The unit to use for the returned data points.

For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference .