Interface ICfnEventSourceMappingProps
Properties for defining a CfnEventSourceMapping
.
Namespace: Amazon.CDK.AWS.Lambda
Assembly: Amazon.CDK.AWS.Lambda.dll
Syntax (csharp)
public interface ICfnEventSourceMappingProps
Syntax (vb)
Public Interface ICfnEventSourceMappingProps
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lambda;
var cfnEventSourceMappingProps = new CfnEventSourceMappingProps {
FunctionName = "functionName",
// the properties below are optional
AmazonManagedKafkaEventSourceConfig = new AmazonManagedKafkaEventSourceConfigProperty {
ConsumerGroupId = "consumerGroupId"
},
BatchSize = 123,
BisectBatchOnFunctionError = false,
DestinationConfig = new DestinationConfigProperty {
OnFailure = new OnFailureProperty {
Destination = "destination"
}
},
DocumentDbEventSourceConfig = new DocumentDBEventSourceConfigProperty {
CollectionName = "collectionName",
DatabaseName = "databaseName",
FullDocument = "fullDocument"
},
Enabled = false,
EventSourceArn = "eventSourceArn",
FilterCriteria = new FilterCriteriaProperty {
Filters = new [] { new FilterProperty {
Pattern = "pattern"
} }
},
FunctionResponseTypes = new [] { "functionResponseTypes" },
MaximumBatchingWindowInSeconds = 123,
MaximumRecordAgeInSeconds = 123,
MaximumRetryAttempts = 123,
ParallelizationFactor = 123,
Queues = new [] { "queues" },
ScalingConfig = new ScalingConfigProperty {
MaximumConcurrency = 123
},
SelfManagedEventSource = new SelfManagedEventSourceProperty {
Endpoints = new EndpointsProperty {
KafkaBootstrapServers = new [] { "kafkaBootstrapServers" }
}
},
SelfManagedKafkaEventSourceConfig = new SelfManagedKafkaEventSourceConfigProperty {
ConsumerGroupId = "consumerGroupId"
},
SourceAccessConfigurations = new [] { new SourceAccessConfigurationProperty {
Type = "type",
Uri = "uri"
} },
StartingPosition = "startingPosition",
StartingPositionTimestamp = 123,
Topics = new [] { "topics" },
TumblingWindowInSeconds = 123
};
Synopsis
Properties
AmazonManagedKafkaEventSourceConfig | Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source. |
BatchSize | The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. |
BisectBatchOnFunctionError | (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. |
DestinationConfig | (Kinesis and DynamoDB Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records. |
DocumentDbEventSourceConfig | Specific configuration settings for a DocumentDB event source. |
Enabled | When true, the event source mapping is active. When false, Lambda pauses polling and invocation. |
EventSourceArn | The Amazon Resource Name (ARN) of the event source. |
FilterCriteria | An object that defines the filter criteria that determine whether Lambda should process an event. |
FunctionName | The name of the Lambda function. |
FunctionResponseTypes | (Streams and SQS) A list of current response type enums applied to the event source mapping. |
MaximumBatchingWindowInSeconds | The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. |
MaximumRecordAgeInSeconds | (Kinesis and DynamoDB Streams only) Discard records older than the specified age. |
MaximumRetryAttempts | (Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. |
ParallelizationFactor | (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. |
Queues | (Amazon MQ) The name of the Amazon MQ broker destination queue to consume. |
ScalingConfig | (Amazon SQS only) The scaling configuration for the event source. |
SelfManagedEventSource | The self-managed Apache Kafka cluster for your event source. |
SelfManagedKafkaEventSourceConfig | Specific configuration settings for a self-managed Apache Kafka event source. |
SourceAccessConfigurations | An array of the authentication protocol, VPC components, or virtual host to secure and define your event source. |
StartingPosition | The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB. |
StartingPositionTimestamp | With |
Topics | The name of the Kafka topic. |
TumblingWindowInSeconds | (Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. |
Properties
AmazonManagedKafkaEventSourceConfig
Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
virtual object AmazonManagedKafkaEventSourceConfig { get; }
Property Value
System.Object
Remarks
BatchSize
The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function.
virtual Nullable<double> BatchSize { get; }
Property Value
System.Nullable<System.Double>
Remarks
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).
BisectBatchOnFunctionError
(Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry.
virtual object BisectBatchOnFunctionError { get; }
Property Value
System.Object
Remarks
DestinationConfig
(Kinesis and DynamoDB Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
virtual object DestinationConfig { get; }
Property Value
System.Object
Remarks
DocumentDbEventSourceConfig
Specific configuration settings for a DocumentDB event source.
virtual object DocumentDbEventSourceConfig { get; }
Property Value
System.Object
Remarks
Enabled
When true, the event source mapping is active. When false, Lambda pauses polling and invocation.
virtual object Enabled { get; }
Property Value
System.Object
Remarks
EventSourceArn
The Amazon Resource Name (ARN) of the event source.
virtual string EventSourceArn { get; }
Property Value
System.String
Remarks
FilterCriteria
An object that defines the filter criteria that determine whether Lambda should process an event.
virtual object FilterCriteria { get; }
Property Value
System.Object
Remarks
FunctionName
The name of the Lambda function.
string FunctionName { get; }
Property Value
System.String
Remarks
Name formats - Function name – 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
(Streams and SQS) A list of current response type enums applied to the event source mapping.
virtual string[] FunctionResponseTypes { get; }
Property Value
System.String[]
Remarks
Valid Values: ReportBatchItemFailures
MaximumBatchingWindowInSeconds
The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.
virtual Nullable<double> MaximumBatchingWindowInSeconds { get; }
Property Value
System.Nullable<System.Double>
Remarks
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
(Kinesis and DynamoDB Streams only) Discard records older than the specified age.
virtual Nullable<double> MaximumRecordAgeInSeconds { get; }
Property Value
System.Nullable<System.Double>
Remarks
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
(Kinesis and DynamoDB Streams only) Discard records after the specified number of retries.
virtual Nullable<double> MaximumRetryAttempts { get; }
Property Value
System.Nullable<System.Double>
Remarks
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.
ParallelizationFactor
(Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard.
virtual Nullable<double> ParallelizationFactor { get; }
Property Value
System.Nullable<System.Double>
Remarks
Queues
(Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
virtual string[] Queues { get; }
Property Value
System.String[]
Remarks
ScalingConfig
(Amazon SQS only) The scaling configuration for the event source.
virtual object ScalingConfig { get; }
Property Value
System.Object
Remarks
SelfManagedEventSource
The self-managed Apache Kafka cluster for your event source.
virtual object SelfManagedEventSource { get; }
Property Value
System.Object
Remarks
SelfManagedKafkaEventSourceConfig
Specific configuration settings for a self-managed Apache Kafka event source.
virtual object SelfManagedKafkaEventSourceConfig { get; }
Property Value
System.Object
Remarks
SourceAccessConfigurations
An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
virtual object SourceAccessConfigurations { get; }
Property Value
System.Object
Remarks
StartingPosition
The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB.
virtual string StartingPosition { get; }
Property Value
System.String
Remarks
StartingPositionTimestamp
With StartingPosition
set to AT_TIMESTAMP
, the time from which to start reading, in Unix time seconds.
virtual Nullable<double> StartingPositionTimestamp { get; }
Property Value
System.Nullable<System.Double>
Remarks
Topics
The name of the Kafka topic.
virtual string[] Topics { get; }
Property Value
System.String[]
Remarks
TumblingWindowInSeconds
(Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources.
virtual Nullable<double> TumblingWindowInSeconds { get; }
Property Value
System.Nullable<System.Double>
Remarks
A value of 0 seconds indicates no tumbling window.