AWS::IoT::CustomMetricUse the `AWS::IoT::CustomMetric` resource to define a custom metric published by your devices to Device Defender. For API reference, see [CreateCustomMetric](https://docs.aws.amazon.com/iot/latest/apireference/API_CreateCustomMetric.html) and for general information, see [Custom metrics](https://docs.aws.amazon.com/iot/latest/developerguide/dd-detect-custom-metrics.html) .
import { CfnCustomMetric } from 'aws-cdk-lib/aws-iot';Or use the module namespace:
import * as iot from 'aws-cdk-lib/aws-iot';
// iot.CfnCustomMetricConfiguration passed to the constructor as CfnCustomMetricProps.
metricTypeRequiredstringThe type of the custom metric. Types include `string-list` , `ip-address-list` , `number-list` , and `number` . > The type `number` only 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.
displayNameOptionalstringThe 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.
metricNameOptionalstringThe 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.
tagsOptionalCfnTag[]Metadata that can be used to manage the custom metric.
This L1 construct maps directly to the following CloudFormation resource type.
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-iotAWS::IoT::CustomMetric