Interface CfnEventSourceMappingProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CfnEventSourceMappingProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:40.614Z") @Stability(Stable) public interface CfnEventSourceMappingProps extends software.amazon.jsii.JsiiSerializable
Properties for defining a CfnEventSourceMapping.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.lambda.*;
 CfnEventSourceMappingProps cfnEventSourceMappingProps = CfnEventSourceMappingProps.builder()
         .functionName("functionName")
         // the properties below are optional
         .amazonManagedKafkaEventSourceConfig(AmazonManagedKafkaEventSourceConfigProperty.builder()
                 .consumerGroupId("consumerGroupId")
                 .build())
         .batchSize(123)
         .bisectBatchOnFunctionError(false)
         .destinationConfig(DestinationConfigProperty.builder()
                 .onFailure(OnFailureProperty.builder()
                         .destination("destination")
                         .build())
                 .build())
         .documentDbEventSourceConfig(DocumentDBEventSourceConfigProperty.builder()
                 .collectionName("collectionName")
                 .databaseName("databaseName")
                 .fullDocument("fullDocument")
                 .build())
         .enabled(false)
         .eventSourceArn("eventSourceArn")
         .filterCriteria(FilterCriteriaProperty.builder()
                 .filters(List.of(FilterProperty.builder()
                         .pattern("pattern")
                         .build()))
                 .build())
         .functionResponseTypes(List.of("functionResponseTypes"))
         .maximumBatchingWindowInSeconds(123)
         .maximumRecordAgeInSeconds(123)
         .maximumRetryAttempts(123)
         .parallelizationFactor(123)
         .queues(List.of("queues"))
         .scalingConfig(ScalingConfigProperty.builder()
                 .maximumConcurrency(123)
                 .build())
         .selfManagedEventSource(SelfManagedEventSourceProperty.builder()
                 .endpoints(EndpointsProperty.builder()
                         .kafkaBootstrapServers(List.of("kafkaBootstrapServers"))
                         .build())
                 .build())
         .selfManagedKafkaEventSourceConfig(SelfManagedKafkaEventSourceConfigProperty.builder()
                 .consumerGroupId("consumerGroupId")
                 .build())
         .sourceAccessConfigurations(List.of(SourceAccessConfigurationProperty.builder()
                 .type("type")
                 .uri("uri")
                 .build()))
         .startingPosition("startingPosition")
         .startingPositionTimestamp(123)
         .topics(List.of("topics"))
         .tumblingWindowInSeconds(123)
         .build();
 
  • Method Details

    • getFunctionName

      @Stability(Stable) @NotNull String getFunctionName()
      The name of the Lambda function.

      Name formats - Function nameMyFunction .

      • Function ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction .
      • Version or Alias ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD .
      • Partial ARN123456789012:function:MyFunction .

      The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.

    • getAmazonManagedKafkaEventSourceConfig

      @Stability(Stable) @Nullable default Object getAmazonManagedKafkaEventSourceConfig()
      Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
    • getBatchSize

      @Stability(Stable) @Nullable default Number getBatchSize()
      The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function.

      Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).

      • Amazon Kinesis – Default 100. Max 10,000.
      • Amazon DynamoDB Streams – Default 100. Max 10,000.
      • Amazon Simple Queue Service – Default 10. For standard queues the max is 10,000. For FIFO queues the max is 10.
      • Amazon Managed Streaming for Apache Kafka – Default 100. Max 10,000.
      • Self-managed Apache Kafka – Default 100. Max 10,000.
      • Amazon MQ (ActiveMQ and RabbitMQ) – Default 100. Max 10,000.
      • DocumentDB – Default 100. Max 10,000.
    • getBisectBatchOnFunctionError

      @Stability(Stable) @Nullable default Object getBisectBatchOnFunctionError()
      (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry.

      The default value is false.

    • getDestinationConfig

      @Stability(Stable) @Nullable default Object getDestinationConfig()
      (Kinesis and DynamoDB Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
    • getDocumentDbEventSourceConfig

      @Stability(Stable) @Nullable default Object getDocumentDbEventSourceConfig()
      Specific configuration settings for a DocumentDB event source.
    • getEnabled

      @Stability(Stable) @Nullable default Object getEnabled()
      When true, the event source mapping is active. When false, Lambda pauses polling and invocation.

      Default: True

    • getEventSourceArn

      @Stability(Stable) @Nullable default String getEventSourceArn()
      The Amazon Resource Name (ARN) of the event source.

      • Amazon Kinesis – The ARN of the data stream or a stream consumer.
      • Amazon DynamoDB Streams – The ARN of the stream.
      • Amazon Simple Queue Service – The ARN of the queue.
      • Amazon Managed Streaming for Apache Kafka – The ARN of the cluster.
      • Amazon MQ – The ARN of the broker.
      • Amazon DocumentDB – The ARN of the DocumentDB change stream.
    • getFilterCriteria

      @Stability(Stable) @Nullable default Object getFilterCriteria()
      An object that defines the filter criteria that determine whether Lambda should process an event.

      For more information, see Lambda event filtering .

    • getFunctionResponseTypes

      @Stability(Stable) @Nullable default List<String> getFunctionResponseTypes()
      (Streams and SQS) A list of current response type enums applied to the event source mapping.

      Valid Values: ReportBatchItemFailures

    • getMaximumBatchingWindowInSeconds

      @Stability(Stable) @Nullable default Number getMaximumBatchingWindowInSeconds()
      The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.

      Default ( Kinesis , DynamoDB , Amazon SQS event sources) : 0

      Default ( Amazon MSK , Kafka, Amazon MQ , Amazon DocumentDB event sources) : 500 ms

      Related setting: For Amazon SQS event sources, when you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

    • getMaximumRecordAgeInSeconds

      @Stability(Stable) @Nullable default Number getMaximumRecordAgeInSeconds()
      (Kinesis and DynamoDB Streams only) Discard records older than the specified age.

      The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records.

      The minimum valid value for maximum record age is 60s. Although values less than 60 and greater than -1 fall within the parameter's absolute range, they are not allowed

    • getMaximumRetryAttempts

      @Stability(Stable) @Nullable default Number getMaximumRetryAttempts()
      (Kinesis and DynamoDB Streams only) Discard records after the specified number of retries.

      The default value is -1, which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.

    • getParallelizationFactor

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

      The default value is 1.

    • getQueues

      @Stability(Stable) @Nullable default List<String> getQueues()
      (Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
    • getScalingConfig

      @Stability(Stable) @Nullable default Object getScalingConfig()
      (Amazon SQS only) The scaling configuration for the event source.

      For more information, see Configuring maximum concurrency for Amazon SQS event sources .

    • getSelfManagedEventSource

      @Stability(Stable) @Nullable default Object getSelfManagedEventSource()
      The self-managed Apache Kafka cluster for your event source.
    • getSelfManagedKafkaEventSourceConfig

      @Stability(Stable) @Nullable default Object getSelfManagedKafkaEventSourceConfig()
      Specific configuration settings for a self-managed Apache Kafka event source.
    • getSourceAccessConfigurations

      @Stability(Stable) @Nullable default Object getSourceAccessConfigurations()
      An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
    • getStartingPosition

      @Stability(Stable) @Nullable default String getStartingPosition()
      The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB.

      • LATEST - Read only new records.
      • TRIM_HORIZON - Process all available records.
      • AT_TIMESTAMP - Specify a time from which to start reading records.
    • getStartingPositionTimestamp

      @Stability(Stable) @Nullable default Number getStartingPositionTimestamp()
      With StartingPosition set to AT_TIMESTAMP , the time from which to start reading, in Unix time seconds.
    • getTopics

      @Stability(Stable) @Nullable default List<String> getTopics()
      The name of the Kafka topic.
    • getTumblingWindowInSeconds

      @Stability(Stable) @Nullable default Number getTumblingWindowInSeconds()
      (Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources.

      A value of 0 seconds indicates no tumbling window.

    • builder

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