public static final class EventSourceMapping.Builder
extends java.lang.Object
EventSourceMapping
.Modifier and Type | Method and Description |
---|---|
EventSourceMapping.Builder |
batchSize(java.lang.Number batchSize)
The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.
|
EventSourceMapping.Builder |
bisectBatchOnError(java.lang.Boolean bisectBatchOnError)
If the function returns an error, split the batch in two and retry.
|
EventSourceMapping |
build() |
static EventSourceMapping.Builder |
create(software.constructs.Construct scope,
java.lang.String id) |
EventSourceMapping.Builder |
enabled(java.lang.Boolean enabled)
Set to false to disable the event source upon creation.
|
EventSourceMapping.Builder |
eventSourceArn(java.lang.String eventSourceArn)
The Amazon Resource Name (ARN) of the event source.
|
EventSourceMapping.Builder |
kafkaBootstrapServers(java.util.List<java.lang.String> kafkaBootstrapServers)
A list of host and port pairs that are the addresses of the Kafka brokers in a self managed "bootstrap" Kafka cluster that a Kafka client connects to initially to bootstrap itself.
|
EventSourceMapping.Builder |
kafkaTopic(java.lang.String kafkaTopic)
The name of the Kafka topic.
|
EventSourceMapping.Builder |
maxBatchingWindow(Duration maxBatchingWindow)
The maximum amount of time to gather records before invoking the function.
|
EventSourceMapping.Builder |
maxRecordAge(Duration maxRecordAge)
The maximum age of a record that Lambda sends to a function for processing.
|
EventSourceMapping.Builder |
onFailure(IEventSourceDlq onFailure)
An Amazon SQS queue or Amazon SNS topic destination for discarded records.
|
EventSourceMapping.Builder |
parallelizationFactor(java.lang.Number parallelizationFactor)
The number of batches to process from each shard concurrently.
|
EventSourceMapping.Builder |
reportBatchItemFailures(java.lang.Boolean reportBatchItemFailures)
Allow functions to return partially successful responses for a batch of records.
|
EventSourceMapping.Builder |
retryAttempts(java.lang.Number retryAttempts)
The maximum number of times to retry when the function returns an error.
|
EventSourceMapping.Builder |
sourceAccessConfigurations(java.util.List<? extends SourceAccessConfiguration> sourceAccessConfigurations)
Specific settings like the authentication protocol or the VPC components to secure access to your event source.
|
EventSourceMapping.Builder |
startingPosition(StartingPosition startingPosition)
The position in the DynamoDB, Kinesis or MSK stream where AWS Lambda should start reading.
|
EventSourceMapping.Builder |
target(IFunction target)
The target AWS Lambda function.
|
EventSourceMapping.Builder |
tumblingWindow(Duration tumblingWindow)
The size of the tumbling windows to group records sent to DynamoDB or Kinesis.
|
public static EventSourceMapping.Builder create(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.EventSourceMapping.Builder
.public EventSourceMapping.Builder batchSize(java.lang.Number batchSize)
Your function receives an event with all the retrieved records.
Valid Range: Minimum value of 1. Maximum value of 10000.
Default: - Amazon Kinesis, Amazon DynamoDB, and Amazon MSK is 100 records. The default for Amazon SQS is 10 messages. For standard SQS queues, the maximum is 10,000. For FIFO SQS queues, the maximum is 10.
batchSize
- The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function. This parameter is required.this
public EventSourceMapping.Builder bisectBatchOnError(java.lang.Boolean bisectBatchOnError)
Default: false
bisectBatchOnError
- If the function returns an error, split the batch in two and retry. This parameter is required.this
public EventSourceMapping.Builder enabled(java.lang.Boolean enabled)
Default: true
enabled
- Set to false to disable the event source upon creation. This parameter is required.this
public EventSourceMapping.Builder eventSourceArn(java.lang.String eventSourceArn)
Any record added to this stream can invoke the Lambda function.
Default: - not set if using a self managed Kafka cluster, throws an error otherwise
eventSourceArn
- The Amazon Resource Name (ARN) of the event source. This parameter is required.this
public EventSourceMapping.Builder kafkaBootstrapServers(java.util.List<java.lang.String> kafkaBootstrapServers)
They are in the format abc.example.com:9096
.
Default: - none
kafkaBootstrapServers
- A list of host and port pairs that are the addresses of the Kafka brokers in a self managed "bootstrap" Kafka cluster that a Kafka client connects to initially to bootstrap itself. This parameter is required.this
public EventSourceMapping.Builder kafkaTopic(java.lang.String kafkaTopic)
Default: - no topic
kafkaTopic
- The name of the Kafka topic. This parameter is required.this
public EventSourceMapping.Builder maxBatchingWindow(Duration maxBatchingWindow)
Maximum of Duration.minutes(5)
Default: Duration.seconds(0)
maxBatchingWindow
- The maximum amount of time to gather records before invoking the function. This parameter is required.this
public EventSourceMapping.Builder maxRecordAge(Duration maxRecordAge)
Valid Range:
Default: - infinite or until the record expires.
maxRecordAge
- The maximum age of a record that Lambda sends to a function for processing. This parameter is required.this
public EventSourceMapping.Builder onFailure(IEventSourceDlq onFailure)
Default: discarded records are ignored
onFailure
- An Amazon SQS queue or Amazon SNS topic destination for discarded records. This parameter is required.this
public EventSourceMapping.Builder parallelizationFactor(java.lang.Number parallelizationFactor)
Valid Range:
Default: 1
parallelizationFactor
- The number of batches to process from each shard concurrently. This parameter is required.this
public EventSourceMapping.Builder reportBatchItemFailures(java.lang.Boolean reportBatchItemFailures)
Default: false
reportBatchItemFailures
- Allow functions to return partially successful responses for a batch of records. This parameter is required.this
public EventSourceMapping.Builder retryAttempts(java.lang.Number retryAttempts)
Set to undefined
if you want lambda to keep retrying infinitely or until
the record expires.
Valid Range:
Default: - infinite or until the record expires.
retryAttempts
- The maximum number of times to retry when the function returns an error. This parameter is required.this
public EventSourceMapping.Builder sourceAccessConfigurations(java.util.List<? extends SourceAccessConfiguration> sourceAccessConfigurations)
Default: - none
sourceAccessConfigurations
- Specific settings like the authentication protocol or the VPC components to secure access to your event source. This parameter is required.this
public EventSourceMapping.Builder startingPosition(StartingPosition startingPosition)
Default: - Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources.
startingPosition
- The position in the DynamoDB, Kinesis or MSK stream where AWS Lambda should start reading. This parameter is required.this
public EventSourceMapping.Builder tumblingWindow(Duration tumblingWindow)
Default: - None
tumblingWindow
- The size of the tumbling windows to group records sent to DynamoDB or Kinesis. This parameter is required.this
public EventSourceMapping.Builder target(IFunction target)
target
- The target AWS Lambda function. This parameter is required.this
public EventSourceMapping build()