StreamEventSourceProps

class aws_cdk.aws_lambda_event_sources.StreamEventSourceProps(*, starting_position, batch_size=None, bisect_batch_on_error=None, max_batching_window=None, max_record_age=None, on_failure=None, parallelization_factor=None, retry_attempts=None)

Bases: object

__init__(*, starting_position, batch_size=None, bisect_batch_on_error=None, max_batching_window=None, max_record_age=None, on_failure=None, parallelization_factor=None, retry_attempts=None)

The set of properties for event sources that follow the streaming model, such as, Dynamo and Kinesis.

Parameters
  • starting_position (StartingPosition) – Where to begin consuming the stream.

  • batch_size (Union[int, float, None]) – 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: - 1000 for {@link DynamoEventSource} - 10000 for {@link KinesisEventSource} Default: 100

  • bisect_batch_on_error (Optional[bool]) – If the function returns an error, split the batch in two and retry. Default: false

  • max_batching_window (Optional[Duration]) – The maximum amount of time to gather records before invoking the function. Maximum of Duration.minutes(5) Default: Duration.seconds(0)

  • max_record_age (Optional[Duration]) – 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: Duration.days(7)

  • on_failure (Optional[IEventSourceDlq]) – An Amazon SQS queue or Amazon SNS topic destination for discarded records. Default: discarded records are ignored

  • parallelization_factor (Union[int, float, None]) – The number of batches to process from each shard concurrently. Valid Range: - Minimum value of 1 - Maximum value of 10 Default: 1

  • retry_attempts (Union[int, float, None]) – Maximum number of retry attempts Valid Range: * Minimum value of 0 * Maximum value of 10000. Default: 10000

Return type

None

Attributes

batch_size

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:

    • 1000 for {@link DynamoEventSource}

    • 10000 for {@link KinesisEventSource}

default :default: 100

Return type

Union[int, float, None]

bisect_batch_on_error

If the function returns an error, split the batch in two and retry.

default :default: false

Return type

Optional[bool]

max_batching_window

The maximum amount of time to gather records before invoking the function.

Maximum of Duration.minutes(5)

default :default: Duration.seconds(0)

Return type

Optional[Duration]

max_record_age

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 :default: Duration.days(7)

Return type

Optional[Duration]

on_failure

An Amazon SQS queue or Amazon SNS topic destination for discarded records.

default :default: discarded records are ignored

Return type

Optional[IEventSourceDlq]

parallelization_factor

The number of batches to process from each shard concurrently.

Valid Range:

  • Minimum value of 1

  • Maximum value of 10

default :default: 1

Return type

Union[int, float, None]

retry_attempts
  • Minimum value of 0 * Maximum value of 10000.

default :default: 10000

Type

Maximum number of retry attempts Valid Range

Return type

Union[int, float, None]

starting_position

Where to begin consuming the stream.

Return type

StartingPosition