Skip to content
v2.278.0

Experimental

@aws-cdk/aws-iot-actions-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

FirehoseRecordSeparator Enum ​

Record Separator to be used to separate records.

Example ​

ts
import * as firehose from 'aws-cdk-lib/aws-kinesisfirehose';

const bucket = new s3.Bucket(this, 'MyBucket');
const stream = new firehose.DeliveryStream(this, 'MyStream', {
  destination: new firehose.S3Bucket(bucket),
});

const topicRule = new iot.TopicRule(this, 'TopicRule', {
  sql: iot.IotSql.fromStringAsVer20160323("SELECT * FROM 'device/+/data'"),
  actions: [
    new actions.FirehosePutRecordAction(stream, {
      batchMode: true,
      recordSeparator: actions.FirehoseRecordSeparator.NEWLINE,
    }),
  ],
});
python
import aws_cdk.aws_kinesisfirehose as firehose


bucket = s3.Bucket(self, "MyBucket")
stream = firehose.DeliveryStream(self, "MyStream",
    destination=firehose.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
        )
    ]
)
java
import software.amazon.awscdk.services.kinesisfirehose.*;


Bucket bucket = new Bucket(this, "MyBucket");
DeliveryStream stream = DeliveryStream.Builder.create(this, "MyStream")
        .destination(new S3Bucket(bucket))
        .build();

TopicRule topicRule = TopicRule.Builder.create(this, "TopicRule")
        .sql(IotSql.fromStringAsVer20160323("SELECT * FROM 'device/+/data'"))
        .actions(List.of(
            FirehosePutRecordAction.Builder.create(stream)
                    .batchMode(true)
                    .recordSeparator(FirehoseRecordSeparator.NEWLINE)
                    .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.IoT.Actions.Alpha
using Amazon.CDK.AWS.KinesisFirehose;


var bucket = new Bucket(this, "MyBucket");
var stream = new DeliveryStream(this, "MyStream", new DeliveryStreamProps {
    Destination = new S3Bucket(bucket)
});

var topicRule = new TopicRule(this, "TopicRule", new TopicRuleProps {
    Sql = IotSql.FromStringAsVer20160323("SELECT * FROM 'device/+/data'"),
    Actions = new [] {
        new FirehosePutRecordAction(stream, new FirehosePutRecordActionProps {
            BatchMode = true,
            RecordSeparator = FirehoseRecordSeparator.NEWLINE
        }) }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkiotactionsalpha/v2
import "github.com/aws/aws-cdk-go/awscdk"


bucket := s3.NewBucket(this, jsii.String("MyBucket"))
stream := firehose.NewDeliveryStream(this, jsii.String("MyStream"), &DeliveryStreamProps{
	Destination: firehose.NewS3Bucket(bucket),
})

topicRule := iot.NewTopicRule(this, jsii.String("TopicRule"), &TopicRuleProps{
	Sql: iot.IotSql_FromStringAsVer20160323(jsii.String("SELECT * FROM 'device/+/data'")),
	Actions: []IAction{
		actions.NewFirehosePutRecordAction(stream, &FirehosePutRecordActionProps{
			BatchMode: jsii.Boolean(true),
			RecordSeparator: actions.FirehoseRecordSeparator_NEWLINE,
		}),
	},
})

Members ​

MemberDescription
NEWLINESeparate by a new line.
TABSeparate by a tab.
WINDOWS_NEWLINESeparate by a windows new line.
COMMASeparate by a comma.

Referenced by ​