FirehosePutRecordAction

class aws_cdk.aws_iot_actions_alpha.FirehosePutRecordAction(stream, *, batch_mode=None, record_separator=None, role=None)

Bases: object

(experimental) The action to put the record from an MQTT message to the Kinesis Data Firehose stream.

Stability:

experimental

ExampleMetadata:

infused

Example:

import aws_cdk.aws_kinesisfirehose_alpha as firehose
import aws_cdk.aws_kinesisfirehose_destinations_alpha as destinations


bucket = s3.Bucket(self, "MyBucket")
stream = firehose.DeliveryStream(self, "MyStream",
    destinations=[destinations.S3Bucket(bucket)]
)

topic_rule = iot.TopicRule(self, "TopicRule",
    sql=iot.IotSql.from_string_as_ver20160323("SELECT * FROM 'device/+/data'"),
    actions=[
        actions.FirehosePutRecordAction(stream,
            batch_mode=True,
            record_separator=actions.FirehoseRecordSeparator.NEWLINE
        )
    ]
)
Parameters:
  • stream (IDeliveryStream) – The Kinesis Data Firehose stream to which to put records.

  • batch_mode (Optional[bool]) – (experimental) Whether to deliver the Kinesis Data Firehose stream as a batch by using PutRecordBatch. 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. Default: false

  • record_separator (Optional[FirehoseRecordSeparator]) – (experimental) A character separator that will be used to separate records written to the Kinesis Data Firehose stream. Default: - none – the stream does not use a separator

  • role (Optional[IRole]) – (experimental) The IAM role that allows access to AWS service. Default: a new role will be created

Stability:

experimental