---
type: resource-type
title: EventSourceMapping
description: aws resource type AWS::Lambda::EventSourceMapping
name: EventSourceMapping
lexicon: aws
resource_type: AWS::Lambda::EventSourceMapping
---
`AWS::Lambda::EventSourceMapping`, a resource type of the aws lexicon.

## Properties

- `FunctionName` (`string`, required): The name or ARN of the Lambda function. *Name formats** + *Function name* – ``MyFunction``. + *Function ARN* – ``arn:aws:lambda:us-west-2:123456789012:function:MyFunction``. + *Version or Alias ARN* – ``arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD``. + *Partial ARN* – ``123456789012: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.
- `AmazonManagedKafkaEventSourceConfig` (`EventSourceMapping_AmazonManagedKafkaEventSourceConfig`, optional): Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
- `BatchSize` (`number`, optional): 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.
- `BisectBatchOnFunctionError` (`boolean`, optional): (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false. When using ``BisectBatchOnFunctionError``, check the ``BatchSize`` parameter in the ``OnFailure`` destination message's metadata. The ``BatchSize`` could be greater than 1 since LAM consolidates failed messages metadata when writing to the ``OnFailure`` destination.
- `DestinationConfig` (`EventSourceMapping_DestinationConfig`, optional): (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A configuration object that specifies the destination of an event after Lambda processes it.
- `DocumentDBEventSourceConfig` (`EventSourceMapping_DocumentDBEventSourceConfig`, optional): Specific configuration settings for a DocumentDB event source.
- `Enabled` (`boolean`, optional): When true, the event source mapping is active. When false, Lambda pauses polling and invocation. Default: True
- `EventSourceArn` (`string`, optional): 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 or the ARN of the VPC connection (for [cross-account event source mappings](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc)). + *Amazon MQ* – The ARN of the broker. + *Amazon DocumentDB* – The ARN of the DocumentDB change stream.
- `EventSourceMappingArn` (`string`, optional)
- `FilterCriteria` (`EventSourceMapping_FilterCriteria`, optional): An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html).
- `FunctionResponseTypes` (`"ReportBatchItemFailures"[]`, optional): (Kinesis, DynamoDB Streams, and SQS) A list of current response type enums applied to the event source mapping. Valid Values: ``ReportBatchItemFailures``
- `Id` (`string`, optional)
- `KmsKeyArn` (`string`, optional): The ARN of the KMSlong (KMS) customer managed key that Lambda uses to encrypt your function's [filter criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics).
- `LoggingConfig` (`EventSourceMapping_LoggingConfig`, optional): (Amazon MSK, and self-managed Apache Kafka only) The logging configuration for your event source. For more information, see [Event source mapping logging](https://docs.aws.amazon.com/lambda/latest/dg/esm-logging.html).
- `MaximumBatchingWindowInSeconds` (`number`, optional): The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. Default (, , event sources)*: 0 Default (, Kafka, , event sources)*: 500 ms Related setting:* For SQS event sources, when you set ``BatchSize`` to a value greater than 10, you must set ``MaximumBatchingWindowInSeconds`` to at least 1.
- `MaximumRecordAgeInSeconds` (`number`, optional): (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) 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
- `MaximumRetryAttempts` (`number`, optional): (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) 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.
- `MetricsConfig` (`EventSourceMapping_MetricsConfig`, optional): The metrics configuration for your event source. For more information, see [Event source mapping metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics).
- `ParallelizationFactor` (`number`, optional): (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.
- `ProvisionedPollerConfig` (`EventSourceMapping_ProvisionedPollerConfig`, optional): (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The provisioned mode configuration for the event source. For more information, see [provisioned mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode).
- `Queues` (`string[]`, optional): (Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
- `ScalingConfig` (`EventSourceMapping_ScalingConfig`, optional): This property is for Amazon SQS event sources only. You cannot use ``ProvisionedPollerConfig`` while using ``ScalingConfig``. These options are mutually exclusive. To remove the scaling configuration, pass an empty value.
- `SelfManagedEventSource` (`EventSourceMapping_SelfManagedEventSource`, optional): The self-managed Apache Kafka cluster for your event source.
- `SelfManagedKafkaEventSourceConfig` (`EventSourceMapping_SelfManagedKafkaEventSourceConfig`, optional): Specific configuration settings for a self-managed Apache Kafka event source.
- `SourceAccessConfigurations` (`EventSourceMapping_SourceAccessConfiguration[]`, optional): An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
- `StartingPosition` (`string`, optional): 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.
- `StartingPositionTimestamp` (`number`, optional): With ``StartingPosition`` set to ``AT_TIMESTAMP``, the time from which to start reading, in Unix time seconds. ``StartingPositionTimestamp`` cannot be in the future.
- `Tags` (`EventSourceMapping_Tag[]`, optional): A list of tags to add to the event source mapping. You must have the ``lambda:TagResource``, ``lambda:UntagResource``, and ``lambda:ListTags`` permissions for your [principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) to manage the CFN stack. If you don't have these permissions, there might be unexpected behavior with stack-level tags propagating to the resource during resource creation and update.
- `Topics` (`string[]`, optional): The name of the Kafka topic.
- `TumblingWindowInSeconds` (`number`, optional): (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.

## Attributes

- `EventSourceMappingArn`
- `Id`
