Class SqsEventSource.Builder

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

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

    • create

      @Stability(Stable) public static SqsEventSource.Builder create(IQueue queue)
      Parameters:
      queue - This parameter is required.
      Returns:
      a new instance of SqsEventSource.Builder.
    • batchSize

      @Stability(Stable) public SqsEventSource.Builder batchSize(Number 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 10. If maxBatchingWindow is configured, this value can go up to 10,000.

      Default: 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
    • enabled

      @Stability(Stable) public SqsEventSource.Builder enabled(Boolean enabled)
      If the SQS event source mapping should be enabled.

      Default: true

      Parameters:
      enabled - If the SQS event source mapping should be enabled. This parameter is required.
      Returns:
      this
    • maxBatchingWindow

      @Stability(Stable) public SqsEventSource.Builder maxBatchingWindow(Duration maxBatchingWindow)
      The maximum amount of time to gather records before invoking the function.

      Valid Range: Minimum value of 0 minutes. Maximum value of 5 minutes.

      Default: - no batching window. The lambda function will be invoked immediately with the records that are available.

      Parameters:
      maxBatchingWindow - The maximum amount of time to gather records before invoking the function. This parameter is required.
      Returns:
      this
    • reportBatchItemFailures

      @Stability(Stable) public SqsEventSource.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:
    • build

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