CfnCustomMetricProps
Struct External
Properties for defining a CfnCustomMetric.
| Source |
|---|
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iot as iot } from 'aws-cdk-lib';
const cfnCustomMetricProps: iot.CfnCustomMetricProps = {
metricType: 'metricType',
// the properties below are optional
displayName: 'displayName',
metricName: 'metricName',
tags: [{
key: 'key',
value: 'value',
}],
};
python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_iot as iot
cfn_custom_metric_props = iot.CfnCustomMetricProps(
metric_type="metricType",
# the properties below are optional
display_name="displayName",
metric_name="metricName",
tags=[CfnTag(
key="key",
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.iot.*;
CfnCustomMetricProps cfnCustomMetricProps = CfnCustomMetricProps.builder()
.metricType("metricType")
// the properties below are optional
.displayName("displayName")
.metricName("metricName")
.tags(List.of(CfnTag.builder()
.key("key")
.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.IoT;
var cfnCustomMetricProps = new CfnCustomMetricProps {
MetricType = "metricType",
// the properties below are optional
DisplayName = "displayName",
MetricName = "metricName",
Tags = new [] { new CfnTag {
Key = "key",
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"
cfnCustomMetricProps := &CfnCustomMetricProps{
MetricType: jsii.String("metricType"),
// the properties below are optional
DisplayName: jsii.String("displayName"),
MetricName: jsii.String("metricName"),
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
}
Properties
displayNameoptionalstringdisplay_nameoptionalstrdisplayNameoptionalStringDisplayNameoptionalstringDisplayNameoptional*string #The friendly name in the console for the custom metric.
This name doesn't have to be unique. Don't use this name as the metric identifier in the device metric report. You can update the friendly name after you define it.
metricNameoptionalstringmetric_nameoptionalstrmetricNameoptionalStringMetricNameoptionalstringMetricNameoptional*string #The name of the custom metric.
This will be used in the metric report submitted from the device/thing. The name can't begin with aws: . You can’t change the name after you define it.
The type of the custom metric. Types include `string-list` , `ip-address-list` , `number-list` , and `number` .
The type
numberonly takes a single metric value as an input, but when you submit the metrics value in the DeviceMetrics report, you must pass it as an array with a single value.