Class CfnEventSourceMapping.Builder

java.lang.Object
software.amazon.awscdk.services.lambda.CfnEventSourceMapping.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CfnEventSourceMapping>
Enclosing class:
CfnEventSourceMapping

@Stability(Stable) public static final class CfnEventSourceMapping.Builder extends Object implements software.amazon.jsii.Builder<CfnEventSourceMapping>
A fluent builder for CfnEventSourceMapping.
  • Method Details

    • create

      @Stability(Stable) public static CfnEventSourceMapping.Builder create(Construct scope, String id)
      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      Returns:
      a new instance of CfnEventSourceMapping.Builder.
    • functionName

      @Stability(Stable) public CfnEventSourceMapping.Builder functionName(String functionName)
      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.

      Parameters:
      functionName - The name of the Lambda function. This parameter is required.
      Returns:
      this
    • amazonManagedKafkaEventSourceConfig

      @Stability(Stable) public CfnEventSourceMapping.Builder amazonManagedKafkaEventSourceConfig(IResolvable amazonManagedKafkaEventSourceConfig)
      Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.

      Parameters:
      amazonManagedKafkaEventSourceConfig - Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source. This parameter is required.
      Returns:
      this
    • amazonManagedKafkaEventSourceConfig

      @Stability(Stable) public CfnEventSourceMapping.Builder amazonManagedKafkaEventSourceConfig(CfnEventSourceMapping.AmazonManagedKafkaEventSourceConfigProperty amazonManagedKafkaEventSourceConfig)
      Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.

      Parameters:
      amazonManagedKafkaEventSourceConfig - Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source. This parameter is required.
      Returns:
      this
    • batchSize

      @Stability(Stable) public CfnEventSourceMapping.Builder batchSize(Number batchSize)
      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.

      Parameters:
      batchSize - The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. This parameter is required.
      Returns:
      this
    • bisectBatchOnFunctionError

      @Stability(Stable) public CfnEventSourceMapping.Builder bisectBatchOnFunctionError(Boolean bisectBatchOnFunctionError)
      (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry.

      The default value is false.

      Parameters:
      bisectBatchOnFunctionError - (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. This parameter is required.
      Returns:
      this
    • bisectBatchOnFunctionError

      @Stability(Stable) public CfnEventSourceMapping.Builder bisectBatchOnFunctionError(IResolvable bisectBatchOnFunctionError)
      (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry.

      The default value is false.

      Parameters:
      bisectBatchOnFunctionError - (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. This parameter is required.
      Returns:
      this
    • destinationConfig

      @Stability(Stable) public CfnEventSourceMapping.Builder destinationConfig(IResolvable destinationConfig)
      (Kinesis and DynamoDB Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records.

      Parameters:
      destinationConfig - (Kinesis and DynamoDB Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records. This parameter is required.
      Returns:
      this
    • destinationConfig

      @Stability(Stable) public CfnEventSourceMapping.Builder destinationConfig(CfnEventSourceMapping.DestinationConfigProperty destinationConfig)
      (Kinesis and DynamoDB Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records.

      Parameters:
      destinationConfig - (Kinesis and DynamoDB Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records. This parameter is required.
      Returns:
      this
    • documentDbEventSourceConfig

      @Stability(Stable) public CfnEventSourceMapping.Builder documentDbEventSourceConfig(IResolvable documentDbEventSourceConfig)
      Specific configuration settings for a DocumentDB event source.

      Parameters:
      documentDbEventSourceConfig - Specific configuration settings for a DocumentDB event source. This parameter is required.
      Returns:
      this
    • documentDbEventSourceConfig

      @Stability(Stable) public CfnEventSourceMapping.Builder documentDbEventSourceConfig(CfnEventSourceMapping.DocumentDBEventSourceConfigProperty documentDbEventSourceConfig)
      Specific configuration settings for a DocumentDB event source.

      Parameters:
      documentDbEventSourceConfig - Specific configuration settings for a DocumentDB event source. This parameter is required.
      Returns:
      this
    • enabled

      @Stability(Stable) public CfnEventSourceMapping.Builder enabled(Boolean enabled)
      When true, the event source mapping is active. When false, Lambda pauses polling and invocation.

      Default: True

      Parameters:
      enabled - When true, the event source mapping is active. When false, Lambda pauses polling and invocation. This parameter is required.
      Returns:
      this
    • enabled

      @Stability(Stable) public CfnEventSourceMapping.Builder enabled(IResolvable enabled)
      When true, the event source mapping is active. When false, Lambda pauses polling and invocation.

      Default: True

      Parameters:
      enabled - When true, the event source mapping is active. When false, Lambda pauses polling and invocation. This parameter is required.
      Returns:
      this
    • eventSourceArn

      @Stability(Stable) public CfnEventSourceMapping.Builder eventSourceArn(String eventSourceArn)
      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.

      Parameters:
      eventSourceArn - The Amazon Resource Name (ARN) of the event source. This parameter is required.
      Returns:
      this
    • filterCriteria

      @Stability(Stable) public CfnEventSourceMapping.Builder filterCriteria(IResolvable filterCriteria)
      An object that defines the filter criteria that determine whether Lambda should process an event.

      For more information, see Lambda event filtering .

      Parameters:
      filterCriteria - An object that defines the filter criteria that determine whether Lambda should process an event. This parameter is required.
      Returns:
      this
    • filterCriteria

      @Stability(Stable) public CfnEventSourceMapping.Builder filterCriteria(CfnEventSourceMapping.FilterCriteriaProperty filterCriteria)
      An object that defines the filter criteria that determine whether Lambda should process an event.

      For more information, see Lambda event filtering .

      Parameters:
      filterCriteria - An object that defines the filter criteria that determine whether Lambda should process an event. This parameter is required.
      Returns:
      this
    • functionResponseTypes

      @Stability(Stable) public CfnEventSourceMapping.Builder functionResponseTypes(List<String> functionResponseTypes)
      (Streams and SQS) A list of current response type enums applied to the event source mapping.

      Valid Values: ReportBatchItemFailures

      Parameters:
      functionResponseTypes - (Streams and SQS) A list of current response type enums applied to the event source mapping. This parameter is required.
      Returns:
      this
    • maximumBatchingWindowInSeconds

      @Stability(Stable) public CfnEventSourceMapping.Builder maximumBatchingWindowInSeconds(Number maximumBatchingWindowInSeconds)
      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.

      Parameters:
      maximumBatchingWindowInSeconds - The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. This parameter is required.
      Returns:
      this
    • maximumRecordAgeInSeconds

      @Stability(Stable) public CfnEventSourceMapping.Builder maximumRecordAgeInSeconds(Number maximumRecordAgeInSeconds)
      (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

      Parameters:
      maximumRecordAgeInSeconds - (Kinesis and DynamoDB Streams only) Discard records older than the specified age. This parameter is required.
      Returns:
      this
    • maximumRetryAttempts

      @Stability(Stable) public CfnEventSourceMapping.Builder maximumRetryAttempts(Number maximumRetryAttempts)
      (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.

      Parameters:
      maximumRetryAttempts - (Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. This parameter is required.
      Returns:
      this
    • parallelizationFactor

      @Stability(Stable) public CfnEventSourceMapping.Builder parallelizationFactor(Number parallelizationFactor)
      (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard.

      The default value is 1.

      Parameters:
      parallelizationFactor - (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. This parameter is required.
      Returns:
      this
    • queues

      @Stability(Stable) public CfnEventSourceMapping.Builder queues(List<String> queues)
      (Amazon MQ) The name of the Amazon MQ broker destination queue to consume.

      Parameters:
      queues - (Amazon MQ) The name of the Amazon MQ broker destination queue to consume. This parameter is required.
      Returns:
      this
    • scalingConfig

      @Stability(Stable) public CfnEventSourceMapping.Builder scalingConfig(IResolvable scalingConfig)
      (Amazon SQS only) The scaling configuration for the event source.

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

      Parameters:
      scalingConfig - (Amazon SQS only) The scaling configuration for the event source. This parameter is required.
      Returns:
      this
    • scalingConfig

      @Stability(Stable) public CfnEventSourceMapping.Builder scalingConfig(CfnEventSourceMapping.ScalingConfigProperty scalingConfig)
      (Amazon SQS only) The scaling configuration for the event source.

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

      Parameters:
      scalingConfig - (Amazon SQS only) The scaling configuration for the event source. This parameter is required.
      Returns:
      this
    • selfManagedEventSource

      @Stability(Stable) public CfnEventSourceMapping.Builder selfManagedEventSource(IResolvable selfManagedEventSource)
      The self-managed Apache Kafka cluster for your event source.

      Parameters:
      selfManagedEventSource - The self-managed Apache Kafka cluster for your event source. This parameter is required.
      Returns:
      this
    • selfManagedEventSource

      @Stability(Stable) public CfnEventSourceMapping.Builder selfManagedEventSource(CfnEventSourceMapping.SelfManagedEventSourceProperty selfManagedEventSource)
      The self-managed Apache Kafka cluster for your event source.

      Parameters:
      selfManagedEventSource - The self-managed Apache Kafka cluster for your event source. This parameter is required.
      Returns:
      this
    • selfManagedKafkaEventSourceConfig

      @Stability(Stable) public CfnEventSourceMapping.Builder selfManagedKafkaEventSourceConfig(IResolvable selfManagedKafkaEventSourceConfig)
      Specific configuration settings for a self-managed Apache Kafka event source.

      Parameters:
      selfManagedKafkaEventSourceConfig - Specific configuration settings for a self-managed Apache Kafka event source. This parameter is required.
      Returns:
      this
    • selfManagedKafkaEventSourceConfig

      @Stability(Stable) public CfnEventSourceMapping.Builder selfManagedKafkaEventSourceConfig(CfnEventSourceMapping.SelfManagedKafkaEventSourceConfigProperty selfManagedKafkaEventSourceConfig)
      Specific configuration settings for a self-managed Apache Kafka event source.

      Parameters:
      selfManagedKafkaEventSourceConfig - Specific configuration settings for a self-managed Apache Kafka event source. This parameter is required.
      Returns:
      this
    • sourceAccessConfigurations

      @Stability(Stable) public CfnEventSourceMapping.Builder sourceAccessConfigurations(IResolvable sourceAccessConfigurations)
      An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.

      Parameters:
      sourceAccessConfigurations - An array of the authentication protocol, VPC components, or virtual host to secure and define your event source. This parameter is required.
      Returns:
      this
    • sourceAccessConfigurations

      @Stability(Stable) public CfnEventSourceMapping.Builder sourceAccessConfigurations(List<? extends Object> sourceAccessConfigurations)
      An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.

      Parameters:
      sourceAccessConfigurations - An array of the authentication protocol, VPC components, or virtual host to secure and define your event source. This parameter is required.
      Returns:
      this
    • startingPosition

      @Stability(Stable) public CfnEventSourceMapping.Builder startingPosition(String startingPosition)
      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.

      Parameters:
      startingPosition - The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB. This parameter is required.
      Returns:
      this
    • startingPositionTimestamp

      @Stability(Stable) public CfnEventSourceMapping.Builder startingPositionTimestamp(Number startingPositionTimestamp)
      With StartingPosition set to AT_TIMESTAMP , the time from which to start reading, in Unix time seconds.

      Parameters:
      startingPositionTimestamp - With StartingPosition set to AT_TIMESTAMP , the time from which to start reading, in Unix time seconds. This parameter is required.
      Returns:
      this
    • topics

      @Stability(Stable) public CfnEventSourceMapping.Builder topics(List<String> topics)
      The name of the Kafka topic.

      Parameters:
      topics - The name of the Kafka topic. This parameter is required.
      Returns:
      this
    • tumblingWindowInSeconds

      @Stability(Stable) public CfnEventSourceMapping.Builder tumblingWindowInSeconds(Number tumblingWindowInSeconds)
      (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.

      Parameters:
      tumblingWindowInSeconds - (Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public CfnEventSourceMapping build()
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnEventSourceMapping>
      Returns:
      a newly built instance of CfnEventSourceMapping.