MetricProperty Struct
Represents a specific metric.
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudwatch as cloudwatch } from 'aws-cdk-lib';
const metricProperty: cloudwatch.CfnAnomalyDetector.MetricProperty = {
metricName: 'metricName',
namespace: 'namespace',
// the properties below are optional
dimensions: [{
name: 'name',
value: 'value',
}],
};
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_cloudwatch as cloudwatch
metric_property = cloudwatch.CfnAnomalyDetector.MetricProperty(
metric_name="metricName",
namespace="namespace",
# the properties below are optional
dimensions=[cloudwatch.CfnAnomalyDetector.DimensionProperty(
name="name",
value="value"
)]
)
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.cloudwatch.*;
MetricProperty metricProperty = MetricProperty.builder()
.metricName("metricName")
.namespace("namespace")
// the properties below are optional
.dimensions(List.of(DimensionProperty.builder()
.name("name")
.value("value")
.build()))
.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.CloudWatch;
var metricProperty = new MetricProperty {
MetricName = "metricName",
Namespace = "namespace",
// the properties below are optional
Dimensions = new [] { new DimensionProperty {
Name = "name",
Value = "value"
} }
};
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"
metricProperty := &MetricProperty{
MetricName: jsii.String("metricName"),
Namespace: jsii.String("namespace"),
// the properties below are optional
Dimensions: []interface{}{
&DimensionProperty{
Name: jsii.String("name"),
Value: jsii.String("value"),
},
},
}
Properties
dimensionsoptionalIResolvable | IResolvable | CfnAnomalyDetector.DimensionProperty[]dimensionsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, DimensionProperty]]]dimensionsoptionalIResolvableDimensionsoptionalIResolvableDimensionsoptionalinterface{}#The dimensions for the metric.
The name of the metric.
This is a required field.
The namespace of the metric.