Skip to content

QueueLambdaSubscriber

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

The QueueLambdaSubscriber component is internally used by the Queue component to add consumer to Amazon SQS.

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


Constructor

new QueueLambdaSubscriber(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 records that’ll be processed by the subscriber function.

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 you Queue contains records in this JSON format.

{
RecordNumber: 0000,
RequestCode: "AAAA",
TimeStamp: "yyyy-mm-ddThh:mm:ss"
}

To process only those records where the RequestCode is BBBB.

{
filters: [
{
body: {
RequestCode: ["BBBB"]
}
}
]
}

And to process only those records where RecordNumber greater than 9999.

{
filters: [
{
body: {
RecordNumber: [{ numeric: [ ">", 9999 ] }]
}
}
]
}

queue

Type Input<Object>

The queue to use.

queue.arn

Type Input<string>

The ARN of the queue.

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 => void)

Transform the Lambda Event Source Mapping resource.