Interface EventSourceMappingOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
EventSourceMappingProps
All Known Implementing Classes:
EventSourceMappingOptions.Jsii$Proxy, EventSourceMappingProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:24:03.909Z") @Stability(Stable) public interface EventSourceMappingOptions extends software.amazon.jsii.JsiiSerializable
Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.*;
 import software.amazon.awscdk.services.kms.*;
 import software.amazon.awscdk.services.lambda.*;
 IEventSourceDlq eventSourceDlq;
 Object filters;
 Key key;
 SourceAccessConfigurationType sourceAccessConfigurationType;
 EventSourceMappingOptions eventSourceMappingOptions = EventSourceMappingOptions.builder()
         .batchSize(123)
         .bisectBatchOnError(false)
         .enabled(false)
         .eventSourceArn("eventSourceArn")
         .filterEncryption(key)
         .filters(List.of(Map.of(
                 "filtersKey", filters)))
         .kafkaBootstrapServers(List.of("kafkaBootstrapServers"))
         .kafkaConsumerGroupId("kafkaConsumerGroupId")
         .kafkaTopic("kafkaTopic")
         .maxBatchingWindow(Duration.minutes(30))
         .maxConcurrency(123)
         .maxRecordAge(Duration.minutes(30))
         .metricsConfig(MetricsConfig.builder()
                 .metrics(List.of(MetricType.EVENT_COUNT))
                 .build())
         .onFailure(eventSourceDlq)
         .parallelizationFactor(123)
         .provisionedPollerConfig(ProvisionedPollerConfig.builder()
                 .maximumPollers(123)
                 .minimumPollers(123)
                 .build())
         .reportBatchItemFailures(false)
         .retryAttempts(123)
         .sourceAccessConfigurations(List.of(SourceAccessConfiguration.builder()
                 .type(sourceAccessConfigurationType)
                 .uri("uri")
                 .build()))
         .startingPosition(StartingPosition.TRIM_HORIZON)
         .startingPositionTimestamp(123)
         .supportS3OnFailureDestination(false)
         .tumblingWindow(Duration.minutes(30))
         .build();
 
  • Method Details

    • getBatchSize

      @Stability(Stable) @Nullable default Number getBatchSize()
      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.

    • getBisectBatchOnError

      @Stability(Stable) @Nullable default Boolean getBisectBatchOnError()
      If the function returns an error, split the batch in two and retry.

      Default: false

    • getEnabled

      @Stability(Stable) @Nullable default Boolean getEnabled()
      Set to false to disable the event source upon creation.

      Default: true

    • getEventSourceArn

      @Stability(Stable) @Nullable default String getEventSourceArn()
      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

    • getFilterEncryption

      @Stability(Stable) @Nullable default IKey getFilterEncryption()
      Add Customer managed KMS key to encrypt Filter Criteria.

      Default: - none

      See Also:
    • getFilters

      @Stability(Stable) @Nullable default List<Map<String,Object>> getFilters()
      Add filter criteria to Event Source.

      Default: - none

      See Also:
    • getKafkaBootstrapServers

      @Stability(Stable) @Nullable default List<String> getKafkaBootstrapServers()
      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

    • getKafkaConsumerGroupId

      @Stability(Stable) @Nullable default String getKafkaConsumerGroupId()
      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

      See Also:
    • getKafkaTopic

      @Stability(Stable) @Nullable default String getKafkaTopic()
      The name of the Kafka topic.

      Default: - no topic

    • getMaxBatchingWindow

      @Stability(Stable) @Nullable default Duration getMaxBatchingWindow()
      The maximum amount of time to gather records before invoking the function.

      Maximum of Duration.minutes(5)

      Default: Duration.seconds(0)

    • getMaxConcurrency

      @Stability(Stable) @Nullable default Number getMaxConcurrency()
      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.

      See Also:
    • getMaxRecordAge

      @Stability(Stable) @Nullable default Duration getMaxRecordAge()
      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.

    • getMetricsConfig

      @Stability(Stable) @Nullable default MetricsConfig getMetricsConfig()
      Configuration for enhanced monitoring metrics collection When specified, enables collection of additional metrics for the stream event source.

      Default: - Enhanced monitoring is disabled

    • getOnFailure

      @Stability(Stable) @Nullable default IEventSourceDlq getOnFailure()
      An Amazon SQS queue or Amazon SNS topic destination for discarded records.

      Default: discarded records are ignored

    • getParallelizationFactor

      @Stability(Stable) @Nullable default Number getParallelizationFactor()
      The number of batches to process from each shard concurrently.

      Valid Range:

      • Minimum value of 1
      • Maximum value of 10

      Default: 1

    • getProvisionedPollerConfig

      @Stability(Stable) @Nullable default ProvisionedPollerConfig getProvisionedPollerConfig()
      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

    • getReportBatchItemFailures

      @Stability(Stable) @Nullable default Boolean getReportBatchItemFailures()
      Allow functions to return partially successful responses for a batch of records.

      Default: false

      See Also:
    • getRetryAttempts

      @Stability(Stable) @Nullable default Number getRetryAttempts()
      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.

    • getSourceAccessConfigurations

      @Stability(Stable) @Nullable default List<SourceAccessConfiguration> getSourceAccessConfigurations()
      Specific settings like the authentication protocol or the VPC components to secure access to your event source.

      Default: - none

      See Also:
    • getStartingPosition

      @Stability(Stable) @Nullable default StartingPosition getStartingPosition()
      The position in the DynamoDB, Kinesis or MSK stream where AWS Lambda should start reading.

      Default: - no starting position

      See Also:
    • getStartingPositionTimestamp

      @Stability(Stable) @Nullable default Number getStartingPositionTimestamp()
      The time from which to start reading, in Unix time seconds.

      Default: - no timestamp

    • getSupportS3OnFailureDestination

      @Stability(Stable) @Nullable default Boolean getSupportS3OnFailureDestination()
      Check if support S3 onfailure destination(ODF).

      Currently only MSK and self managed kafka event support S3 ODF

      Default: false

    • getTumblingWindow

      @Stability(Stable) @Nullable default Duration getTumblingWindow()
      The size of the tumbling windows to group records sent to DynamoDB or Kinesis.

      Default: - None

      See Also:
    • builder

      @Stability(Stable) static EventSourceMappingOptions.Builder builder()
      Returns:
      a EventSourceMappingOptions.Builder of EventSourceMappingOptions