# CfnEventSourceMapping

The `AWS::Lambda::EventSourceMapping` resource creates a mapping between an event source and an AWS Lambda function.

Lambda reads items from the event source and triggers the function.

For details about each event source type, see the following topics. In particular, each of the topics describes the required and optional parameters for the specific event source.

- [Configuring a Dynamo DB stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping)
- [Configuring a Kinesis stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping)
- [Configuring an SQS queue as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource)
- [Configuring an MQ broker as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping)
- [Configuring MSK as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html)
- [Configuring Self-Managed Apache Kafka as an event source](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html)
- [Configuring Amazon DocumentDB as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html)

Extends: Construct › CfnElement › CfnRefElement › CfnResource › CfnEventSourceMapping
Implements: IInspectable, ITaggableV2, IEnvironmentAware, IEventSourceMappingRef, IConstruct, IDependable

- CloudFormation: [`AWS::Lambda::EventSourceMapping`](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-lambda-eventsourcemapping.html)
- Source: Generated code
- Type last changed: v2.252.0 · 30 Apr 2026

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda as lambda } from 'aws-cdk-lib';
const cfnEventSourceMapping = new lambda.CfnEventSourceMapping(this, 'MyCfnEventSourceMapping', {
  functionName: 'functionName',

  // the properties below are optional
  amazonManagedKafkaEventSourceConfig: {
    consumerGroupId: 'consumerGroupId',
    schemaRegistryConfig: {
      accessConfigs: [{
        type: 'type',
        uri: 'uri',
      }],
      eventRecordFormat: 'eventRecordFormat',
      schemaRegistryUri: 'schemaRegistryUri',
      schemaValidationConfigs: [{
        attribute: 'attribute',
      }],
    },
  },
  batchSize: 123,
  bisectBatchOnFunctionError: false,
  destinationConfig: {
    onFailure: {
      destination: 'destination',
    },
  },
  documentDbEventSourceConfig: {
    collectionName: 'collectionName',
    databaseName: 'databaseName',
    fullDocument: 'fullDocument',
  },
  enabled: false,
  eventSourceArn: 'eventSourceArn',
  filterCriteria: {
    filters: [{
      pattern: 'pattern',
    }],
  },
  functionResponseTypes: ['functionResponseTypes'],
  kmsKeyArn: 'kmsKeyArn',
  loggingConfig: {
    systemLogLevel: 'systemLogLevel',
  },
  maximumBatchingWindowInSeconds: 123,
  maximumRecordAgeInSeconds: 123,
  maximumRetryAttempts: 123,
  metricsConfig: {
    metrics: ['metrics'],
  },
  parallelizationFactor: 123,
  provisionedPollerConfig: {
    maximumPollers: 123,
    minimumPollers: 123,
    pollerGroupName: 'pollerGroupName',
  },
  queues: ['queues'],
  scalingConfig: {
    maximumConcurrency: 123,
  },
  selfManagedEventSource: {
    endpoints: {
      kafkaBootstrapServers: ['kafkaBootstrapServers'],
    },
  },
  selfManagedKafkaEventSourceConfig: {
    consumerGroupId: 'consumerGroupId',
    consumptionMode: 'consumptionMode',
    schemaRegistryConfig: {
      accessConfigs: [{
        type: 'type',
        uri: 'uri',
      }],
      eventRecordFormat: 'eventRecordFormat',
      schemaRegistryUri: 'schemaRegistryUri',
      schemaValidationConfigs: [{
        attribute: 'attribute',
      }],
    },
  },
  sourceAccessConfigurations: [{
    type: 'type',
    uri: 'uri',
  }],
  startingPosition: 'startingPosition',
  startingPositionTimestamp: 123,
  tags: [{
    key: 'key',
    value: 'value',
  }],
  topics: ['topics'],
  tumblingWindowInSeconds: 123,
});
```

## Initializer

```ts
new CfnEventSourceMapping(scope: Construct, id: string, props: CfnEventSourceMappingProps)
```

## Construct Props

- `amazonManagedKafkaEventSourceConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.AmazonManagedKafkaEventSourceConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.AmazonManagedKafkaEventSourceConfigProperty.html) — Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.

- `batchSize`: number — 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 | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — (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 Lambda consolidates failed messages metadata when writing to the `OnFailure` destination.

- `destinationConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.DestinationConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.DestinationConfigProperty.html) — (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`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.DocumentDBEventSourceConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.DocumentDBEventSourceConfigProperty.html) — Specific configuration settings for a DocumentDB event source.

- `enabled`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — When true, the event source mapping is active. When false, Lambda pauses polling and invocation.

  Default: True

- `eventSourceArn`: string | [IStreamRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_kinesis.IStreamRef.html) | [IClusterRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_msk.IClusterRef.html) | [IQueueRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_sqs.IQueueRef.html) — 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.

- `filterCriteria`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.FilterCriteriaProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.FilterCriteriaProperty.html) — 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) .

- `functionName`: string | [IFunctionRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_lambda.IFunctionRef.html) | [IVersionRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_lambda.IVersionRef.html) (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.

- `functionResponseTypes`: string[] — (Kinesis, DynamoDB Streams, and SQS) A list of current response type enums applied to the event source mapping.

  Valid Values: `ReportBatchItemFailures`

- `kmsKeyArn`: string — The ARN of the AWS Key Management Service ( AWS ) 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`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.LoggingConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.LoggingConfigProperty.html) — The function's Amazon CloudWatch Logs configuration settings.

- `maximumBatchingWindowInSeconds`: number — The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.

  *Default ( Kinesis , DynamoDB , Amazon SQS event sources)* : 0

  *Default ( Amazon MSK , Kafka, Amazon MQ , Amazon DocumentDB event sources)* : 500 ms

  *Related setting:* For Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1.

- `maximumRecordAgeInSeconds`: number — (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 — (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`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.MetricsConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.MetricsConfigProperty.html) — 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 — (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard.

  The default value is 1.

- `provisionedPollerConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.ProvisionedPollerConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.ProvisionedPollerConfigProperty.html) — (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[] — (Amazon MQ) The name of the Amazon MQ broker destination queue to consume.

- `scalingConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.ScalingConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.ScalingConfigProperty.html) — 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`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.SelfManagedEventSourceProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.SelfManagedEventSourceProperty.html) — The self-managed Apache Kafka cluster for your event source.

- `selfManagedKafkaEventSourceConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.SelfManagedKafkaEventSourceConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.SelfManagedKafkaEventSourceConfigProperty.html) — Specific configuration settings for a self-managed Apache Kafka event source.

- `sourceAccessConfigurations`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.SourceAccessConfigurationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.SourceAccessConfigurationProperty.html)[] — An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.

- `startingPosition`: string — 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 — With `StartingPosition` set to `AT_TIMESTAMP` , the time from which to start reading, in Unix time seconds.

  `StartingPositionTimestamp` cannot be in the future.

- `tags`: [CfnTag](/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — 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 [IAM principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) to manage the CloudFormation 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[] — The name of the Kafka topic.

- `tumblingWindowInSeconds`: number — (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.

## Properties

- `amazonManagedKafkaEventSourceConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.AmazonManagedKafkaEventSourceConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.AmazonManagedKafkaEventSourceConfigProperty.html) — Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.

- `attrEventSourceMappingArn`: string (required) — The Amazon Resource Name (ARN) of the event source mapping.

- `attrId`: string (required) — The event source mapping's ID.

- `batchSize`: number — The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function.

- `bisectBatchOnFunctionError`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry.

- `cdkTagManager`: [TagManager](/cdk/api/v2/docs/aws-cdk-lib.TagManager.html) (required) — Tag Manager which manages the tags for this resource.

- `CFN_RESOURCE_TYPE_NAME`: string (required) (static) — The CloudFormation resource type name for this resource class.

- `cfnOptions`: [ICfnResourceOptions](/cdk/api/v2/docs/aws-cdk-lib.ICfnResourceOptions.html) (required) — Options for this resource, such as condition, update policy etc.

- `cfnResourceType`: string (required) — AWS resource type.

- `creationStack`: string[] (required)

- `destinationConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.DestinationConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.DestinationConfigProperty.html) — (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`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.DocumentDBEventSourceConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.DocumentDBEventSourceConfigProperty.html) — Specific configuration settings for a DocumentDB event source.

- `enabled`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — When true, the event source mapping is active.

  When false, Lambda pauses polling and invocation.

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) (required)

- `eventSourceArn`: string — The Amazon Resource Name (ARN) of the event source.

- `eventSourceMappingRef`: [EventSourceMappingReference](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_lambda.EventSourceMappingReference.html) (required) — A reference to a EventSourceMapping resource.

- `filterCriteria`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.FilterCriteriaProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.FilterCriteriaProperty.html) — An object that defines the filter criteria that determine whether Lambda should process an event.

- `functionName`: string (required) — The name or ARN of the Lambda function.

- `functionResponseTypes`: string[] — (Kinesis, DynamoDB Streams, and SQS) A list of current response type enums applied to the event source mapping.

- `kmsKeyArn`: string — The ARN of the AWS Key Management Service ( AWS ) 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`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.LoggingConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.LoggingConfigProperty.html) — The function's Amazon CloudWatch Logs configuration settings.

- `logicalId`: string (required) — The logical ID for this CloudFormation stack element.

  The logical ID of the element
  is calculated from the path of the resource node in the construct tree.

  To override this value, use `overrideLogicalId(newLogicalId)`.

- `maximumBatchingWindowInSeconds`: number — The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.

- `maximumRecordAgeInSeconds`: number — (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) Discard records older than the specified age.

- `maximumRetryAttempts`: number — (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) Discard records after the specified number of retries.

- `metricsConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.MetricsConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.MetricsConfigProperty.html) — The metrics configuration for your event source.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) (required) — The tree node.

- `parallelizationFactor`: number — (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard.

- `provisionedPollerConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.ProvisionedPollerConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.ProvisionedPollerConfigProperty.html) — (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The provisioned mode configuration for the event source.

- `queues`: string[] — (Amazon MQ) The name of the Amazon MQ broker destination queue to consume.

- `ref`: string (required) — Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.

  If, by any chance, the intrinsic reference of a resource is not a string, you could
  coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.

- `scalingConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.ScalingConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.ScalingConfigProperty.html) — This property is for Amazon SQS event sources only.

- `selfManagedEventSource`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.SelfManagedEventSourceProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.SelfManagedEventSourceProperty.html) — The self-managed Apache Kafka cluster for your event source.

- `selfManagedKafkaEventSourceConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.SelfManagedKafkaEventSourceConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.SelfManagedKafkaEventSourceConfigProperty.html) — Specific configuration settings for a self-managed Apache Kafka event source.

- `sourceAccessConfigurations`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEventSourceMapping.SourceAccessConfigurationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnEventSourceMapping.SourceAccessConfigurationProperty.html)[] — An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.

- `stack`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html) (required) — The stack in which this element is defined.

  CfnElements must be defined within a stack scope (directly or indirectly).

- `startingPosition`: string — The position in a stream from which to start reading.

  Required for Amazon Kinesis and Amazon DynamoDB.

- `startingPositionTimestamp`: number — With `StartingPosition` set to `AT_TIMESTAMP` , the time from which to start reading, in Unix time seconds.

- `tags`: [CfnTag](/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — A list of tags to add to the event source mapping.

- `topics`: string[] — The name of the Kafka topic.

- `tumblingWindowInSeconds`: number — (Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources.

## Methods

- `addDeletionOverride(path: string): void` — Syntactic sugar for `addOverride(path, undefined)`.

  **Parameters**

  - `path` — The path of the value to delete.

- `addDependency(target: CfnResource): void` — Use `addResourceDependency` instead.

  This method has been renamed to `addResourceDependency` to more clearly
  set it apart from `construct.node.addDependency`. See the documentation
  of that function for more details.

- `addDependsOn(target: CfnResource): void` — Use `addResourceDependency` instead.

  This can be used for resources across stacks (or nested stack) boundaries
  and the dependency will automatically be transferred to the relevant scope.

  This method has been renamed to `addResourceDependency`, which makes it
  more clear that this method operates at a different level from the
  construct-level `construct.node.addDependency()` mechanism.

- `addMetadata(key: string, value: any): void` — Add a value to the CloudFormation Resource Metadata.

- `addOverride(path: string, value: any): void` — Adds an override to the synthesized CloudFormation resource.

  To add a
  property override, either use `addPropertyOverride` or prefix `path` with
  "Properties." (i.e. `Properties.TopicName`).

  If the override is nested, separate each nested level using a dot (.) in the path parameter.
  If there is an array as part of the nesting, specify the index in the path.

  To include a literal `.` in the property name, prefix with a `\`. In most
  programming languages you will need to write this as `"\\."` because the
  `\` itself will need to be escaped.

  For example,
  ```typescript
  cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
  cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
  ```
  would add the overrides
  ```json
  "Properties": {
    "GlobalSecondaryIndexes": [
      {
        "Projection": {
          "NonKeyAttributes": [ "myattribute" ]
          ...
        }
        ...
      },
      {
        "ProjectionType": "INCLUDE"
        ...
      },
    ]
    ...
  }
  ```

  The `value` argument to `addOverride` will not be processed or translated
  in any way. Pass raw JSON values in here with the correct capitalization
  for CloudFormation. If you pass CDK classes or structs, they will be
  rendered with lowercased key names, and CloudFormation will reject the
  template.

  **Parameters**

  - `path` — - The path of the property, you can use dot notation to override values in complex types.
  - `value` — - The value.

- `addPropertyDeletionOverride(propertyPath: string): void` — Adds an override that deletes the value of a property from the resource definition.

  **Parameters**

  - `propertyPath` — The path to the property.

- `addPropertyOverride(propertyPath: string, value: any): void` — Adds an override to a resource property.

  Syntactic sugar for `addOverride("Properties.<...>", value)`.

  **Parameters**

  - `propertyPath` — The path of the property.
  - `value` — The value.

- `addResourceDependency(target: CfnResource, reason?: string): void` — Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

  This can be used for resources across stacks (or nested stack) boundaries
  and the dependency will automatically be transferred to the relevant scope.

  This method only adds dependencies between L1 resources. If you are
  looking for a generic construct-to-construct dependency mechanism that works
  for all constructs including L2s, use `construct.node.addDependency` instead.

- `applyCrossStackReferenceStrength(strength: ReferenceStrength): void` — Sets the cross-stack reference strength for this resource.

  When set, any cross-stack reference to this resource will use the specified
  strength instead of the global default from the consuming stack's context.

  **Parameters**

  - `strength` — - The reference strength to use for this resource.

- `applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void` — Sets the deletion policy of the resource based on the removal policy specified.

  The Removal Policy controls what happens to this resource when it stops
  being managed by CloudFormation, either because you've removed it from the
  CDK application or because you've made a change that requires the resource
  to be replaced.

  The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
  account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
  cases, a snapshot can be taken of the resource prior to deletion
  (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
  can be found in the following link:

- `arnForEventSourceMapping(resource: IEventSourceMappingRef): string` (static)

- `cfnPropertyName(cdkPropertyName: string): string`

- `getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Reference` — Returns a token for an runtime attribute of this resource.

  Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
  in case there is no generated attribute.

  **Parameters**

  - `attributeName` — The name of the attribute.

- `getMetadata(key: string): any` — Retrieve a value value from the CloudFormation Resource Metadata.

- `inspect(inspector: TreeInspector): void` — Examines the CloudFormation resource and discloses attributes.

  **Parameters**

  - `inspector` — tree inspector to collect and process attributes.

- `isCfnElement(x: any): boolean` (static) — Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

  Uses duck-typing instead of `instanceof` to allow stack elements from different
  versions of this library to be included in the same stack.

  **Returns:** The construct as a stack element or undefined if it is not a stack element.

- `isCfnEventSourceMapping(x: any): boolean` (static) — Checks whether the given object is a CfnEventSourceMapping.

- `isCfnResource(x: any): boolean` (static) — Check whether the given object is a CfnResource.

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  Use this method instead of `instanceof` to properly detect `Construct`
  instances, even when the construct library is symlinked.

  Explanation: in JavaScript, multiple copies of the `constructs` library on
  disk are seen as independent, completely different libraries. As a
  consequence, the class `Construct` in each copy of the `constructs` library
  is seen as a different class, and an instance of one class will not test as
  `instanceof` the other class. `npm install` will not create installations
  like this, but users may manually symlink construct libraries together or
  use a monorepo tool: in those cases, multiple copies of the `constructs`
  library can be accidentally installed, and `instanceof` will behave
  unpredictably. It is safest to avoid using `instanceof`, and using
  this type-testing method instead.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `obtainDependencies(): Stack | CfnResource[]` — Retrieves an array of resources and stacks this resource depends on.

  For resources depended on directly, returns the `CfnResource` object. For
  dependencies on other stacks, returns the `Stack` object. The order of the
  array is not guaranteed.

- `overrideLogicalId(newLogicalId: string): void` — Overrides the auto-generated logical ID with a specific ID.

  **Parameters**

  - `newLogicalId` — The new logical ID to use for this stack element.

- `removeDependency(target: CfnResource): void` — Use `removeResourceDependency` instead

  This can be used for resources across stacks (including nested stacks)
  and the dependency will automatically be removed from the relevant scope.

- `removeResourceDependency(target: CfnResource): void` — Indicates that this resource no longer depends on another resource.

  This can be used for resources across stacks (including nested stacks)
  and the dependency will automatically be removed from the relevant scope.

- `replaceDependency(target: CfnResource, newTarget: CfnResource): void` — Replaces one dependency with another.

  **Parameters**

  - `target` — The dependency to replace.
  - `newTarget` — The new dependency to add.

- `toString(): string` — Returns a string representation of this construct.

  **Returns:** a string representation of this resource

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.
  Use multiple `with()` calls if subsequent mixins should apply to added
  constructs.
