BaseStreamEventSourceProps
- class aws_cdk.aws_lambda_event_sources.BaseStreamEventSourceProps(*, starting_position, batch_size=None, enabled=None, max_batching_window=None, provisioned_poller_config=None)
Bases:
object
The set of properties for streaming event sources shared by Dynamo, Kinesis and Kafka.
- 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 forDynamoEventSource
- 10000 forKinesisEventSource
,ManagedKafkaEventSource
andSelfManagedKafkaEventSource
Default: 100enabled (
Optional
[bool
]) – If the stream event source mapping should be enabled. Default: truemax_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) for Kinesis, DynamoDB, and SQS event sources, Duration.millis(500) for MSK, self-managed Kafka, and Amazon MQ.provisioned_poller_config (
Union
[ProvisionedPollerConfig
,Dict
[str
,Any
],None
]) – 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
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk as cdk from aws_cdk import aws_lambda as lambda_ from aws_cdk import aws_lambda_event_sources as lambda_event_sources base_stream_event_source_props = lambda_event_sources.BaseStreamEventSourceProps( starting_position=lambda_.StartingPosition.TRIM_HORIZON, # the properties below are optional batch_size=123, enabled=False, max_batching_window=cdk.Duration.minutes(30), provisioned_poller_config=lambda_event_sources.ProvisionedPollerConfig( maximum_pollers=123, minimum_pollers=123 ) )
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
DynamoEventSource
10000 for
KinesisEventSource
,ManagedKafkaEventSource
andSelfManagedKafkaEventSource
- Default:
100
- enabled
If the stream event source mapping should be enabled.
- Default:
true
- max_batching_window
The maximum amount of time to gather records before invoking the function.
Maximum of Duration.minutes(5).
- Default:
Duration.seconds(0) for Kinesis, DynamoDB, and SQS event sources, Duration.millis(500) for MSK, self-managed Kafka, and Amazon MQ.
- See:
- provisioned_poller_config
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
- starting_position
Where to begin consuming the stream.