Class EventSourceMapping.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<EventSourceMapping>
- Enclosing class:
EventSourceMapping
EventSourceMapping
.-
Method Summary
Modifier and TypeMethodDescriptionThe largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.bisectBatchOnError
(Boolean bisectBatchOnError) If the function returns an error, split the batch in two and retry.build()
static EventSourceMapping.Builder
Set to false to disable the event source upon creation.eventSourceArn
(String eventSourceArn) The Amazon Resource Name (ARN) of the event source.filterEncryption
(IKey filterEncryption) Add Customer managed KMS key to encrypt Filter Criteria.Add filter criteria to Event Source.kafkaBootstrapServers
(List<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.kafkaConsumerGroupId
(String kafkaConsumerGroupId) The identifier for the Kafka consumer group to join.kafkaTopic
(String kafkaTopic) The name of the Kafka topic.maxBatchingWindow
(Duration maxBatchingWindow) The maximum amount of time to gather records before invoking the function.maxConcurrency
(Number maxConcurrency) The maximum concurrency setting limits the number of concurrent instances of the function that an Amazon SQS event source can invoke.maxRecordAge
(Duration maxRecordAge) The maximum age of a record that Lambda sends to a function for processing.metricsConfig
(MetricsConfig metricsConfig) Configuration for enhanced monitoring metrics collection When specified, enables collection of additional metrics for the stream event source.onFailure
(IEventSourceDlq onFailure) An Amazon SQS queue or Amazon SNS topic destination for discarded records.parallelizationFactor
(Number parallelizationFactor) The number of batches to process from each shard concurrently.provisionedPollerConfig
(ProvisionedPollerConfig provisionedPollerConfig) Configuration for provisioned pollers that read from the event source.reportBatchItemFailures
(Boolean reportBatchItemFailures) Allow functions to return partially successful responses for a batch of records.retryAttempts
(Number retryAttempts) The maximum number of times to retry when the function returns an error.sourceAccessConfigurations
(List<? extends SourceAccessConfiguration> sourceAccessConfigurations) Specific settings like the authentication protocol or the VPC components to secure access to your event source.startingPosition
(StartingPosition startingPosition) The position in the DynamoDB, Kinesis or MSK stream where AWS Lambda should start reading.startingPositionTimestamp
(Number startingPositionTimestamp) The time from which to start reading, in Unix time seconds.supportS3OnFailureDestination
(Boolean supportS3OnFailureDestination) Check if support S3 onfailure destination(ODF).The target AWS Lambda function.tumblingWindow
(Duration tumblingWindow) The size of the tumbling windows to group records sent to DynamoDB or Kinesis.
-
Method Details
-
create
@Stability(Stable) public static EventSourceMapping.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
EventSourceMapping.Builder
.
-
batchSize
The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.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.
- Parameters:
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.- Returns:
this
-
bisectBatchOnError
If the function returns an error, split the batch in two and retry.Default: false
- Parameters:
bisectBatchOnError
- If the function returns an error, split the batch in two and retry. This parameter is required.- Returns:
this
-
enabled
Set to false to disable the event source upon creation.Default: true
- Parameters:
enabled
- Set to false to disable the event source upon creation. This parameter is required.- Returns:
this
-
eventSourceArn
The Amazon Resource Name (ARN) of the event source.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
- Parameters:
eventSourceArn
- The Amazon Resource Name (ARN) of the event source. This parameter is required.- Returns:
this
-
filterEncryption
Add Customer managed KMS key to encrypt Filter Criteria.Default: - none
- Parameters:
filterEncryption
- Add Customer managed KMS key to encrypt Filter Criteria. This parameter is required.- Returns:
this
- See Also:
-
filters
@Stability(Stable) public EventSourceMapping.Builder filters(List<? extends Map<String, ? extends Object>> filters) Add filter criteria to Event Source.Default: - none
- Parameters:
filters
- Add filter criteria to Event Source. This parameter is required.- Returns:
this
- See Also:
-
kafkaBootstrapServers
@Stability(Stable) public EventSourceMapping.Builder kafkaBootstrapServers(List<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.They are in the format
abc.example.com:9096
.Default: - none
- Parameters:
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.- Returns:
this
-
kafkaConsumerGroupId
@Stability(Stable) public EventSourceMapping.Builder kafkaConsumerGroupId(String kafkaConsumerGroupId) The identifier for the Kafka consumer group to join.The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. The value must have a lenght between 1 and 200 and full the pattern '[a-zA-Z0-9-/:_+=.@-]'. For more information, see Customizable consumer group ID.
Default: - none
- Parameters:
kafkaConsumerGroupId
- The identifier for the Kafka consumer group to join. This parameter is required.- Returns:
this
- See Also:
-
kafkaTopic
The name of the Kafka topic.Default: - no topic
- Parameters:
kafkaTopic
- The name of the Kafka topic. This parameter is required.- Returns:
this
-
maxBatchingWindow
The maximum amount of time to gather records before invoking the function.Maximum of Duration.minutes(5)
Default: Duration.seconds(0)
- Parameters:
maxBatchingWindow
- The maximum amount of time to gather records before invoking the function. This parameter is required.- Returns:
this
-
maxConcurrency
The maximum concurrency setting limits the number of concurrent instances of the function that an Amazon SQS event source can invoke.Default: - No specific limit.
- Parameters:
maxConcurrency
- The maximum concurrency setting limits the number of concurrent instances of the function that an Amazon SQS event source can invoke. This parameter is required.- Returns:
this
- See Also:
-
maxRecordAge
The maximum age of a record that Lambda sends to a function for processing.Valid Range:
- Minimum value of 60 seconds
- Maximum value of 7 days
Default: - infinite or until the record expires.
- Parameters:
maxRecordAge
- The maximum age of a record that Lambda sends to a function for processing. This parameter is required.- Returns:
this
-
metricsConfig
Configuration for enhanced monitoring metrics collection When specified, enables collection of additional metrics for the stream event source.Default: - Enhanced monitoring is disabled
- Parameters:
metricsConfig
- Configuration for enhanced monitoring metrics collection When specified, enables collection of additional metrics for the stream event source. This parameter is required.- Returns:
this
-
onFailure
An Amazon SQS queue or Amazon SNS topic destination for discarded records.Default: discarded records are ignored
- Parameters:
onFailure
- An Amazon SQS queue or Amazon SNS topic destination for discarded records. This parameter is required.- Returns:
this
-
parallelizationFactor
@Stability(Stable) public EventSourceMapping.Builder parallelizationFactor(Number parallelizationFactor) The number of batches to process from each shard concurrently.Valid Range:
- Minimum value of 1
- Maximum value of 10
Default: 1
- Parameters:
parallelizationFactor
- The number of batches to process from each shard concurrently. This parameter is required.- Returns:
this
-
provisionedPollerConfig
@Stability(Stable) public EventSourceMapping.Builder provisionedPollerConfig(ProvisionedPollerConfig provisionedPollerConfig) Configuration for provisioned pollers that read from the event source.When specified, allows control over the minimum and maximum number of pollers that can be provisioned to process events from the source.
Default: - no provisioned pollers
- Parameters:
provisionedPollerConfig
- Configuration for provisioned pollers that read from the event source. This parameter is required.- Returns:
this
-
reportBatchItemFailures
@Stability(Stable) public EventSourceMapping.Builder reportBatchItemFailures(Boolean reportBatchItemFailures) Allow functions to return partially successful responses for a batch of records.Default: false
- Parameters:
reportBatchItemFailures
- Allow functions to return partially successful responses for a batch of records. This parameter is required.- Returns:
this
- See Also:
-
retryAttempts
The maximum number of times to retry when the function returns an error.Set to
undefined
if you want lambda to keep retrying infinitely or until the record expires.Valid Range:
- Minimum value of 0
- Maximum value of 10000
Default: - infinite or until the record expires.
- Parameters:
retryAttempts
- The maximum number of times to retry when the function returns an error. This parameter is required.- Returns:
this
-
sourceAccessConfigurations
@Stability(Stable) public EventSourceMapping.Builder sourceAccessConfigurations(List<? extends SourceAccessConfiguration> sourceAccessConfigurations) Specific settings like the authentication protocol or the VPC components to secure access to your event source.Default: - none
- Parameters:
sourceAccessConfigurations
- Specific settings like the authentication protocol or the VPC components to secure access to your event source. This parameter is required.- Returns:
this
- See Also:
-
startingPosition
@Stability(Stable) public EventSourceMapping.Builder startingPosition(StartingPosition startingPosition) The position in the DynamoDB, Kinesis or MSK stream where AWS Lambda should start reading.Default: - no starting position
- Parameters:
startingPosition
- The position in the DynamoDB, Kinesis or MSK stream where AWS Lambda should start reading. This parameter is required.- Returns:
this
- See Also:
-
startingPositionTimestamp
@Stability(Stable) public EventSourceMapping.Builder startingPositionTimestamp(Number startingPositionTimestamp) The time from which to start reading, in Unix time seconds.Default: - no timestamp
- Parameters:
startingPositionTimestamp
- The time from which to start reading, in Unix time seconds. This parameter is required.- Returns:
this
-
supportS3OnFailureDestination
@Stability(Stable) public EventSourceMapping.Builder supportS3OnFailureDestination(Boolean supportS3OnFailureDestination) Check if support S3 onfailure destination(ODF).Currently only MSK and self managed kafka event support S3 ODF
Default: false
- Parameters:
supportS3OnFailureDestination
- Check if support S3 onfailure destination(ODF). This parameter is required.- Returns:
this
-
tumblingWindow
The size of the tumbling windows to group records sent to DynamoDB or Kinesis.Default: - None
- Parameters:
tumblingWindow
- The size of the tumbling windows to group records sent to DynamoDB or Kinesis. This parameter is required.- Returns:
this
- See Also:
-
target
The target AWS Lambda function.- Parameters:
target
- The target AWS Lambda function. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<EventSourceMapping>
- Returns:
- a newly built instance of
EventSourceMapping
.
-