Kinesis Data Firehose - AWS IoT Core

Kinesis Data Firehose

The Kinesis Data Firehose(firehose) action sends data from an MQTT message to an Amazon Kinesis Data Firehose stream.

Requirements

This rule action has the following requirements:

  • An IAM role that AWS IoT can assume to perform the firehose:PutRecord operation. For more information, see Granting AWS IoT the required access.

    In the AWS IoT console, you can choose or create a role to allow AWS IoT to perform this rule action.

  • If you use Kinesis Data Firehose to send data to an Amazon S3 bucket, and you use an AWS Key Management Service (AWS KMS) customer-managed AWS KMS key (KMS key) to encrypt data at rest in Amazon S3, Kinesis Data Firehose must have access to your bucket and permission to use the AWS KMS key on the caller's behalf. For more information, see Grant Kinesis Data Firehose access to an Amazon S3 destination in the Amazon Kinesis Data Firehose Developer Guide.

Parameters

When you create an AWS IoT rule with this action, you must specify the following information:

batchMode

(Optional) Whether to deliver the Kinesis Data Firehose stream as a batch by using PutRecordBatch . The default value is false.

When batchMode is true and the rule's SQL statement evaluates to an Array, each Array element forms one record in the PutRecordBatch request. The resulting array can't have more than 500 records.

Supports substitution templates: No

deliveryStreamName

The Kinesis Data Firehose stream to which to write the message data.

Supports substitution templates: API and AWS CLI only

separator

(Optional) A character separator that is used to separate records written to the Kinesis Data Firehose stream. If you omit this parameter, the stream uses no separator. Valid values: , (comma), \t (tab), \n (newline), \r\n (Windows newline).

Supports substitution templates: No

roleArn

The IAM role that allows access to the Kinesis Data Firehose stream. For more information, see Requirements.

Supports substitution templates: No

Examples

The following JSON example defines a Kinesis Data Firehose action in an AWS IoT rule.

{ "topicRulePayload": { "sql": "SELECT * FROM 'some/topic'", "ruleDisabled": false, "awsIotSqlVersion": "2016-03-23", "actions": [ { "firehose": { "deliveryStreamName": "my_firehose_stream", "roleArn": "arn:aws:iam::123456789012:role/aws_iot_firehose" } } ] } }

The following JSON example defines a Kinesis Data Firehose action with substitution templates in an AWS IoT rule.

{ "topicRulePayload": { "sql": "SELECT * FROM 'some/topic'", "ruleDisabled": false, "awsIotSqlVersion": "2016-03-23", "actions": [ { "firehose": { "deliveryStreamName": "${topic()}", "roleArn": "arn:aws:iam::123456789012:role/aws_iot_firehose" } } ] } }

See also