aws-cdk-lib.aws_lambda_event_sources.BaseStreamEventSourceProps

interface BaseStreamEventSourceProps

LanguageType name
.NETAmazon.CDK.AWS.Lambda.EventSources.BaseStreamEventSourceProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslambdaeventsources#BaseStreamEventSourceProps
Javasoftware.amazon.awscdk.services.lambda.eventsources.BaseStreamEventSourceProps
Pythonaws_cdk.aws_lambda_event_sources.BaseStreamEventSourceProps
TypeScript (source)aws-cdk-lib » aws_lambda_event_sources » BaseStreamEventSourceProps

The set of properties for streaming event sources shared by Dynamo, Kinesis and Kafka.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_lambda as lambda } from 'aws-cdk-lib';
import { aws_lambda_event_sources as lambda_event_sources } from 'aws-cdk-lib';
const baseStreamEventSourceProps: lambda_event_sources.BaseStreamEventSourceProps = {
  startingPosition: lambda.StartingPosition.TRIM_HORIZON,

  // the properties below are optional
  batchSize: 123,
  enabled: false,
  maxBatchingWindow: cdk.Duration.minutes(30),
};

Properties

NameTypeDescription
startingPositionStartingPositionWhere to begin consuming the stream.
batchSize?numberThe largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.
enabled?booleanIf the stream event source mapping should be enabled.
maxBatchingWindow?DurationThe maximum amount of time to gather records before invoking the function.

startingPosition

Type: StartingPosition

Where to begin consuming the stream.


batchSize?

Type: number (optional, default: 100)

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 and SelfManagedKafkaEventSource

enabled?

Type: boolean (optional, default: true)

If the stream event source mapping should be enabled.


maxBatchingWindow?

Type: Duration (optional, default: Duration.seconds(0) for Kinesis, DynamoDB, and SQS event sources, Duration.millis(500) for MSK, self-managed Kafka, and Amazon MQ.)

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

Maximum of Duration.minutes(5).

See also: https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-batching