KinesisStreamPutRecord Class
Use an Amazon Kinesis Data Streams as a target for AWS EventBridge Scheduler.
Example
ts
import * as kinesis from 'aws-cdk-lib/aws-kinesis';
const stream = new kinesis.Stream(this, 'MyStream');
new Schedule(this, 'Schedule', {
schedule: ScheduleExpression.rate(Duration.minutes(60)),
target: new targets.KinesisStreamPutRecord(stream, {
partitionKey: 'key',
}),
});
python
import aws_cdk.aws_kinesis as kinesis
stream = kinesis.Stream(self, "MyStream")
Schedule(self, "Schedule",
schedule=ScheduleExpression.rate(Duration.minutes(60)),
target=targets.KinesisStreamPutRecord(stream,
partition_key="key"
)
)
java
import software.amazon.awscdk.services.kinesis.*;
Stream stream = new Stream(this, "MyStream");
Schedule.Builder.create(this, "Schedule")
.schedule(ScheduleExpression.rate(Duration.minutes(60)))
.target(KinesisStreamPutRecord.Builder.create(stream)
.partitionKey("key")
.build())
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.Kinesis;
var stream = new Stream(this, "MyStream");
new Schedule(this, "Schedule", new ScheduleProps {
Schedule = ScheduleExpression.Rate(Duration.Minutes(60)),
Target = new KinesisStreamPutRecord(stream, new KinesisStreamPutRecordProps {
PartitionKey = "key"
})
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import kinesis "github.com/aws/aws-cdk-go/awscdk"
stream := kinesis.NewStream(this, jsii.String("MyStream"))
awscdk.NewSchedule(this, jsii.String("Schedule"), &ScheduleProps{
Schedule: awscdk.ScheduleExpression_Rate(awscdk.Duration_Minutes(jsii.Number(60))),
Target: targets.NewKinesisStreamPutRecord(stream, &KinesisStreamPutRecordProps{
PartitionKey: jsii.String("key"),
}),
})
Initializer
ts
new KinesisStreamPutRecord(stream: IStream, props: KinesisStreamPutRecordProps)
python
KinesisStreamPutRecord(stream: IStream, props: KinesisStreamPutRecordProps)
java
new KinesisStreamPutRecord(IStream stream, KinesisStreamPutRecordProps props)
csharp
new KinesisStreamPutRecord(IStream stream, KinesisStreamPutRecordProps props)
go
NewKinesisStreamPutRecord(Stream IStream, Props KinesisStreamPutRecordProps)
Methods
bind(schedule: ISchedule): ScheduleTargetConfigdef bind(self, schedule: ISchedule) -> ScheduleTargetConfigpublic ScheduleTargetConfig bind(ISchedule schedule)public ScheduleTargetConfig Bind(ISchedule schedule)func Bind(Schedule ISchedule) ScheduleTargetConfig#Create a return a Schedule Target Configuration for the given schedule.
returns
Returns: a Schedule Target Configuration