Experimental
@aws-cdk/aws-iot-actions-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
CloudWatchPutMetricActionProps Struct
Configuration properties of an action for CloudWatch metric.
Example
ts
const topicRule = new iot.TopicRule(this, 'TopicRule', {
sql: iot.IotSql.fromStringAsVer20160323(
"SELECT topic(2) as device_id, namespace, unit, value, timestamp FROM 'device/+/data'",
),
actions: [
new actions.CloudWatchPutMetricAction({
metricName: '${topic(2)}',
metricNamespace: '${namespace}',
metricUnit: '${unit}',
metricValue: '${value}',
metricTimestamp: '${timestamp}',
}),
],
});
Properties
The CloudWatch metric name.
Supports substitution templates.
metricNamespacestringmetric_namespacestrmetricNamespaceStringMetricNamespacestringMetricNamespace*stringrequired#The CloudWatch metric namespace name.
Supports substitution templates.
metricTimestampstringmetric_timestampstrmetricTimestampStringMetricTimestampstringMetricTimestamp*string= none -- Defaults to the current …#A string that contains the timestamp, expressed in seconds in Unix epoch time.
Supports substitution templates.
default
Default: none -- Defaults to the current Unix epoch time.
The metric unit supported by CloudWatch.
Supports substitution templates.
A string that contains the CloudWatch metric value.
Supports substitution templates.