Firehose - Amazon IoT Core
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Firehose

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

Requirements

This rule action has the following requirements:

  • An IAM role that Amazon IoT can assume to perform the firehose:PutRecord operation. For more information, see Granting an Amazon IoT rule the access it requires.

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

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

Parameters

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

batchMode

(Optional) Whether to deliver the 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 Firehose stream to which to write the message data.

Supports substitution templates: API and Amazon CLI only

separator

(Optional) A character separator that is used to separate records written to the 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 Firehose stream. For more information, see Requirements.

Supports substitution templates: No

Examples

The following JSON example defines a Firehose action in an Amazon 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 Firehose action with substitution templates in an Amazon 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