Skip to content

KinesisStreamLambdaSubscriber

Reference doc for the `sst.aws.KinesisStreamLambdaSubscriber` component.

The KinesisStreamLambdaSubscriber component is internally used by the KinesisStream component to add a consumer to Amazon Kinesis Data Streams.

You’ll find this component returned by the subscribe method of the KinesisStream component.


Constructor

new KinesisStreamLambdaSubscriber(name, args, opts?)

Parameters

Properties

nodes

Type Object

The underlying resources this component creates.

nodes.eventSourceMapping

Type EventSourceMapping

The Lambda event source mapping.

nodes.function

Type Output<Function>

The Lambda function that’ll be notified.

Args

filters?

Type Input<Input<Record<string, any>>[]>

Filter the events that’ll be processed by the subscribers functions.

You can pass in up to 5 different filter policies. These will logically ORed together. Meaning that if any single policy matches, the record will be processed. Learn more about the filter rule syntax.

For example, if your Kinesis stream contains events in this JSON format.

{
record: 12345,
order: {
type: "buy",
stock: "ANYCO",
quantity: 1000
}
}

To process only those events where the type is buy.

{
filters: [
{
data: {
order: {
type: ["buy"],
},
},
},
],
}

stream

Type Input<Object>

The Kinesis stream to use.

stream.arn

Type Input<string>

The ARN of the stream.

subscriber

Type Input<string | FunctionArgs>

The subscriber function.

transform?

Type Object

Transform how this component creates its underlying resources.

transform.eventSourceMapping?

Type EventSourceMappingArgs | (args: EventSourceMappingArgs, opts: ComponentResourceOptions, name: string) => void

Transform the Lambda Event Source Mapping resource.