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

class IotEventsPutMessageAction 🔹

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

Implements IAction

The action to put the message from an MQTT message to the IoT Events input.

Example

import * as iotevents from '@aws-cdk/aws-iotevents-alpha';
import * as iam from 'aws-cdk-lib/aws-iam';

declare const role: iam.IRole;

const input = new iotevents.Input(this, 'MyInput', {
  attributeJsonPaths: ['payload.temperature', 'payload.transactionId'],
});
const topicRule = new iot.TopicRule(this, 'TopicRule', {
  sql: iot.IotSql.fromStringAsVer20160323(
    "SELECT * FROM 'device/+/data'",
  ),
  actions: [
    new actions.IotEventsPutMessageAction(input, {
      batchMode: true, // optional property, default is 'false'
      messageId: '${payload.transactionId}', // optional property, default is a new UUID
      role: role, // optional property, default is a new UUID
    }),
  ],
});

Initializer

new IotEventsPutMessageAction(input: IInput, props?: IotEventsPutMessageActionProps)

Parameters

  • input IInput — The IoT Events input to put messages.
  • props IotEventsPutMessageActionProps — Optional properties to not use default.