> **Experimental**
>
> `@aws-cdk/aws-iot-actions-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# IotEventsPutMessageAction

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

Extends: IotEventsPutMessageAction
Implements: IAction

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/iotevents-put-message-action.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-iot-actions-alpha/lib/iotevents-put-message-action.ts#L40)

## Example

```ts
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

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