@@ -32,6 +32,7 @@ Currently supported are:
32
32
- Send messages to SQS queues
33
33
- Publish messages on SNS topics
34
34
- Write messages into columns of DynamoDB
35
+ - Put messages IoT Events input
35
36
36
37
## Republish a message to another MQTT topic
37
38
@@ -73,7 +74,7 @@ new iot.TopicRule(this, 'TopicRule', {
73
74
74
75
## Put objects to a S3 bucket
75
76
76
- The code snippet below creates an AWS IoT Rule that put objects to a S3 bucket
77
+ The code snippet below creates an AWS IoT Rule that puts objects to a S3 bucket
77
78
when it is triggered.
78
79
79
80
``` ts
@@ -126,7 +127,7 @@ new iot.TopicRule(this, 'TopicRule', {
126
127
127
128
## Put logs to CloudWatch Logs
128
129
129
- The code snippet below creates an AWS IoT Rule that put logs to CloudWatch Logs
130
+ The code snippet below creates an AWS IoT Rule that puts logs to CloudWatch Logs
130
131
when it is triggered.
131
132
132
133
``` ts
@@ -194,7 +195,7 @@ const topicRule = new iot.TopicRule(this, 'TopicRule', {
194
195
195
196
## Put records to Kinesis Data stream
196
197
197
- The code snippet below creates an AWS IoT Rule that put records to Kinesis Data
198
+ The code snippet below creates an AWS IoT Rule that puts records to Kinesis Data
198
199
stream when it is triggered.
199
200
200
201
``` ts
@@ -214,7 +215,7 @@ const topicRule = new iot.TopicRule(this, 'TopicRule', {
214
215
215
216
## Put records to Kinesis Data Firehose stream
216
217
217
- The code snippet below creates an AWS IoT Rule that put records to Put records
218
+ The code snippet below creates an AWS IoT Rule that puts records to Put records
218
219
to Kinesis Data Firehose stream when it is triggered.
219
220
220
221
``` ts
@@ -299,3 +300,31 @@ const topicRule = new iot.TopicRule(this, 'TopicRule', {
299
300
],
300
301
});
301
302
```
303
+
304
+ ## Put messages IoT Events input
305
+
306
+ The code snippet below creates an AWS IoT Rule that puts messages
307
+ to an IoT Events input when it is triggered:
308
+
309
+ ``` ts
310
+ import * as iotevents from ' @aws-cdk/aws-iotevents' ;
311
+ import * as iam from ' @aws-cdk/aws-iam' ;
312
+
313
+ declare const role: iam .IRole ;
314
+
315
+ const input = new iotevents .Input (this , ' MyInput' , {
316
+ attributeJsonPaths: [' payload.temperature' , ' payload.transactionId' ],
317
+ });
318
+ const topicRule = new iot .TopicRule (this , ' TopicRule' , {
319
+ sql: iot .IotSql .fromStringAsVer20160323 (
320
+ " SELECT * FROM 'device/+/data'" ,
321
+ ),
322
+ actions: [
323
+ new actions .IotEventsPutMessageAction (input , {
324
+ batchMode: true , // optional property, default is 'false'
325
+ messageId: ' ${payload.transactionId}' , // optional property, default is a new UUID
326
+ role: role , // optional property, default is a new UUID
327
+ }),
328
+ ],
329
+ });
330
+ ```
0 commit comments