@aws-cdk_aws-iot-actions-alpha.CloudWatchPutMetricActionProps

interface CloudWatchPutMetricActionProps ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.IoT.Actions.Alpha.CloudWatchPutMetricActionProps
Gogithub.com/aws/aws-cdk-go/awscdkiotactionsalpha/v2#CloudWatchPutMetricActionProps
Javasoftware.amazon.awscdk.services.iot.actions.alpha.CloudWatchPutMetricActionProps
Pythonaws_cdk.aws_iot_actions_alpha.CloudWatchPutMetricActionProps
TypeScript (source)@aws-cdk/aws-iot-actions-alpha ยป CloudWatchPutMetricActionProps

Configuration properties of an action for CloudWatch metric.

Example

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

NameTypeDescription
metricName๐Ÿ”นstringThe CloudWatch metric name.
metricNamespace๐Ÿ”นstringThe CloudWatch metric namespace name.
metricUnit๐Ÿ”นstringThe metric unit supported by CloudWatch.
metricValue๐Ÿ”นstringA string that contains the CloudWatch metric value.
metricTimestamp?๐Ÿ”นstringA string that contains the timestamp, expressed in seconds in Unix epoch time.
role?๐Ÿ”นIRoleThe IAM role that allows access to AWS service.

metricName๐Ÿ”น

Type: string

The CloudWatch metric name.

Supports substitution templates.

See also: https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html


metricNamespace๐Ÿ”น

Type: string

The CloudWatch metric namespace name.

Supports substitution templates.

See also: https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html


metricUnit๐Ÿ”น

Type: string

The metric unit supported by CloudWatch.

Supports substitution templates.

See also: https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html


metricValue๐Ÿ”น

Type: string

A string that contains the CloudWatch metric value.

Supports substitution templates.

See also: https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html


metricTimestamp?๐Ÿ”น

Type: string (optional, default: none -- Defaults to the current Unix epoch time.)

A string that contains the timestamp, expressed in seconds in Unix epoch time.

Supports substitution templates.

See also: https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html


role?๐Ÿ”น

Type: IRole (optional, default: a new role will be created)

The IAM role that allows access to AWS service.