Class CloudWatchPutMetricAction

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.iot.actions.alpha.CloudWatchPutMetricAction
All Implemented Interfaces:
IAction, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-06T23:25:19.315Z") @Stability(Experimental) public class CloudWatchPutMetricAction extends software.amazon.jsii.JsiiObject implements IAction
(experimental) The action to capture an Amazon CloudWatch metric.

Example:

 TopicRule topicRule = TopicRule.Builder.create(this, "TopicRule")
         .sql(IotSql.fromStringAsVer20160323("SELECT topic(2) as device_id, namespace, unit, value, timestamp FROM 'device/+/data'"))
         .actions(List.of(
             CloudWatchPutMetricAction.Builder.create()
                     .metricName("${topic(2)}")
                     .metricNamespace("${namespace}")
                     .metricUnit("${unit}")
                     .metricValue("${value}")
                     .metricTimestamp("${timestamp}")
                     .build()))
         .build();
 
  • Constructor Details

    • CloudWatchPutMetricAction

      protected CloudWatchPutMetricAction(software.amazon.jsii.JsiiObjectRef objRef)
    • CloudWatchPutMetricAction

      protected CloudWatchPutMetricAction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CloudWatchPutMetricAction

      @Stability(Experimental) public CloudWatchPutMetricAction(@NotNull CloudWatchPutMetricActionProps props)
      Parameters:
      props - This parameter is required.